Fix lost status updates when BATCH_DELIVERY_TIMEOUT is exceeded - #536
Merged
selwin merged 1 commit intoSep 5, 2026
Merged
Conversation
juneja-varun
force-pushed
the
fix-batch-delivery-timeout-lost-status
branch
from
September 4, 2026 20:55
3753cff to
9465710
Compare
Collaborator
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #479.
I hit this running a batch send where one email was slow enough to trip
BATCH_DELIVERY_TIMEOUT. The timeout raised inside_send_bulk()'s results loop with nothing catching it, so the whole function bailed out before updating any email statuses — including the ones in the same batch that had already sent fine. They stayedqueuedand got resent on the next run, over and over as long as the slowness continued.Fix: catch the timeout per-email and route it through the same failed/requeue path already used for other send errors, instead of letting it blow up the batch. Already-sent emails now get marked
sentcorrectly even when a later email in the batch times out.Added a test for this (two emails, one slow, confirms the fast one still ends up
sent), and updated an existing test that had asserted the crash itself as expected behavior.