Skip to content

feature(webhooks): compress in-loop retry backoff so retries start sooner - #250

Merged
MostafaMoradii merged 1 commit into
mainfrom
fix/webhook-backoff-sooner
Jul 27, 2026
Merged

MostafaMoradii merged 1 commit into
mainfrom
fix/webhook-backoff-sooner

Conversation

@MostafaMoradii

Copy link
Copy Markdown
Collaborator

Problem

A webhook delivery that fails could take 156 s to reach its 5th (final) in-loop attempt. With the default webhook_max_attempts=5, the old _BACKOFF_SECONDS = (1, 5, 30, 120, 600) schedule meant a single 120 s sleep sat before the last attempt — so any transient backend outage held the envelope for over two minutes before the last try, and only then handed off to the durable backlog.

Change

Compress the in-loop schedule to (1, 5, 15, 30, 60).

Attempt Old fires at New fires at
1 0 s 0 s
2 1 s 1 s
3 6 s 6 s
4 36 s 21 s
5 156 s 51 s

Full in-loop exhaustion drops from 156 s → 51 s (fast-fail), and no single sleep exceeds 30 s at the default attempt count. The 60 tail only comes into play if an operator raises webhook_max_attempts.

The durable backlog drainer's separate (coarser) schedule is unchanged — rows still only reach it after the in-loop budget is exhausted.

Docs

docs/integration/03-webhooks.md § Delivery semantics updated to match the new schedule.

…oner

Change dispatcher _BACKOFF_SECONDS from (1,5,30,120,600) to
(1,5,15,30,60). At the default max_attempts=5 the old schedule pushed
the 5th attempt to 156s (a single 120s sleep before it); the new
schedule reaches attempt 5 at 51s with no gap over 30s. Update the
delivery-semantics doc to match.
@MostafaMoradii
MostafaMoradii merged commit c2e5ed0 into main Jul 27, 2026
11 checks passed
@MostafaMoradii
MostafaMoradii deleted the fix/webhook-backoff-sooner branch July 27, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant