Retry failed webhook deliveries with exponential backoff #702

Openccarvalho wants to merge 3 commits into main from feat/webhook-retries· opened 3 days ago
+63−21
ccarvalho commented 3 days agoAuthor

Problem

A single 502 from a customer's endpoint currently sends the event straight to the dead letter queue. Support gets a few of these tickets a week ("we missed an invoice.paid event").

Change

  • deliver now retries up to 5 times with exponential backoff (500 ms base)
  • The attempt number is included in the body so receivers can tell retries apart
  • dispatch throws if any endpoint ultimately fails; the worker nacks the job and the queue redelivers it after 60 s instead of dead-lettering it immediately
  • New DeliveryResult enum instead of booleans

Testing

Pointed it at a requestbin that returns 500 and saw 5 attempts in the logs.

ccarvalho added 3 commits 3 days ago
Add backoff helperse33aade
Retry deliveries in dispatchere43aaf7
Nack failed jobs instead of dead-letteringe53ab10

Review required

Review the changes, then submit to get graded.

Some checks haven’t completed yet

1 check: dojo / review-grader

Keyboard shortcuts

Site-wide

Focus the search bar
/
Show this dialog
?

Pull request

Move to the next file
j
Move to the previous file
k
Filter changed files
t
Comment on the selected lines
c
Select a range of lines
Shiftclick