Skip to content

Glossary

What is a circuit breaker?

A circuit breaker stops a client retrying a failing service. AnyReplay dropped its own in SDK 0.2.0: it backs off on a bad network and stops only when refused.

Updated · 1 min read

A circuit breaker is a client-side safeguard that counts consecutive failures against a remote service and, once a threshold is reached, stops sending requests instead of retrying indefinitely.

Why it matters

A recording SDK runs inside someone else's page. If your ingest endpoint is down, blocked or rejecting requests, the worst thing the SDK can do is hammer the network, burning the user's battery and bandwidth for a recording that will never arrive.

A breaker turns a persistent failure into a clean stop. The catch is that a phone in a tunnel looks exactly like a dead server: count five failures and the session ends just as the network comes back. Backoff, waiting longer after each failure, protects the network without giving up on the recording.

How AnyReplay handles it

Up to 0.1.4, both AnyReplay SDKs stopped after 5 consecutive transport failures. From 0.2.0 they back off instead: a failed chunk is kept and retried after 2 seconds, doubling to a minute with some jitter, and never sooner than a Retry-After header asks. Events wait in a bounded buffer, and the backlog goes out in chunks of about 256 KB once the network is back. A real refusal still stops recording: a domain or app that is not on the origin allow-list, a paused project, a used-up plan. So a misconfigured allow-list shows up as sessions that never arrive, and an outage as a session with a gap. The browser SDK keeps maxConsecutiveFailures for anyone who wants the old breaker; its default is now 0, meaning never.

Start free — 1 project, 500 sessions a month

Install the snippet, record a session, and watch it back in your own language.