Network request retry policy
★ 0.0 (0 ratings)60 min0 engineers solved this
Your assignment
This is a Node.js client library for a payments HTTP API. Callers create a client instance and invoke resource methods such as customers.retrieve or charges.create, passing an optional callback or receiving a promise. Each resource method builds a request and hands it to StripeResource, which owns the request lifecycle: it builds headers and the body, sends the request through a pluggable HttpClient (a Node http implementation by default), parses the response, and converts failures into typed error classes. Retry behaviour is configured with the maxNetworkRetries setting and a backoff helper on each resource. Network failures surface as StripeConnectionError with the original low-level error available in the detail field. Tests use mocha, chai and nock to simulate the HTTP layer.
What the team is seeing
Our serverless job fails on its very first customer lookup about a third of the time with a generic connection failure. The same call usually succeeds when we run it again moments later, and we cannot tell why the first attempt is failing.
Acceptance checks 1
- Check 1
Discussion is locked — log in and complete this problem to join the discussion and rate your experience.
