Urgent.News

What's breaking now, across thousands of outlets.

Tech

Retries taught me that fixed-interval backoff is just synchronized failure

When I built the webhook catcher, my first retry loop was naive: on a failed POST delivery, wait 5 seconds and try again, up to 3 times. It worked fine in testing. Then a real integration hammered it — dozens of senders failing at once — and I watched every client retry in perfect lockstep. Five seconds later, a thundering herd. Five seconds after that, another one. The receiver didn't crash, but…

In my exploration of retry policies for a webhook catcher, I initially employed a simple strategy: upon a failed POST delivery, I would wait for five seconds and attempt the request again, up to a maximum of three times. This approach functioned well during testing. However, when subjected to a real-world integration where numerous senders failed simultaneously, I observed every client retrying with perfect synchronicity.

Five seconds later, a surge of retries occurred; five seconds after that, another wave followed. While the receiver did not crash, the spike in retries was evident in the latency graphs, and some senders ultimately gave up during the most intense period. The solution to this issue was straightforward yet essential: implement exponential backoff with full jitter (randomly ranging from 0 to the computed delay), accompanied by a hard retry budget per event.

This precautionary measure ensured that a flaky sender could not indefinitely monopolize resources. Following this adjustment, the retry traffic dispersion improved significantly, tail latency decreased, and the 100-event budget was no longer at risk of being depleted due to duplicate deliveries from impatient clients.

Through this experience, I discovered that a retry policy serves as a load-shaping decision rather than merely an error-handling mechanism. Fixed intervals in retry strategies do not retry; they orchestrate a distributed denial of service (DDoS) against oneself. Jitter is not merely an aesthetic enhancement; it is the crucial factor between recovering from failures and oscillating endlessly between states.

Furthermore, every retry iteration must have a predetermined ceiling, as the concept of "try again" without a limit inevitably transforms into a slow memory leak. To encapsulate all these learnings, I developed a tool available at https://x402.freeq.one/tools/webhook_catch.html, where the 24-hour expiry and event cap double as the retry budget for anyone seeking to test their own webhook hooks.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

The 10-minute code review I run before every merge

Most review comments are noise: style nits, hypothetical concerns, "consider adding a comment". A useful review answers three questions in order — does it break anything, does it handle the edges, is…

  • Ten-minute code review checklist streamlines process with AI assistance
  • First pass reviews behavior by describing system change in one sentence
  • Third pass evaluates if new teammate can understand module without author knowledge

Two MV3 errors you hit right after bumping manifest_version (and the fix)

You change "manifest_version": 2 to 3 and the extension breaks. Two errors show up a lot: Service worker registration failed chrome.browserAction is undefined Below is a small made-up teaching example…

  • Switching manifestversion from 2 to 3 causes two common errors
  • Service worker registration fails in background page of MV3
  • chrome.browserAction renamed to chrome.action in MV3

More from Saturday 7 November →