Skip to content

Fix lost status updates when BATCH_DELIVERY_TIMEOUT is exceeded - #536

Merged
selwin merged 1 commit into
ui:masterfrom
juneja-varun:fix-batch-delivery-timeout-lost-status
Sep 5, 2026
Merged

selwin merged 1 commit into
ui:masterfrom
juneja-varun:fix-batch-delivery-timeout-lost-status

Conversation

@juneja-varun

@juneja-varun juneja-varun commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

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 stayed queued and 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 sent correctly 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.

@juneja-varun
juneja-varun force-pushed the fix-batch-delivery-timeout-lost-status branch from 3753cff to 9465710 Compare September 4, 2026 20:55
@selwin
selwin merged commit c1797d9 into ui:master Sep 5, 2026
@selwin

selwin commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Thanks!

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.

BATCH_DELIVERY_TIMEOUT behavior is broken and leads to emails being sent multiple times

2 participants