fix(queue): bound and isolate the notify-evaluate deliver fan-out - #10140
Conversation
The notify-deliver enqueue after notify-evaluate ran through an unbounded Promise.all over every resolved delivery (which can outnumber the batch's events one-to-many across channels), rejected the whole fan-out on the first send failure, and left the failure completely unlogged. A retry of that job recovers nothing since evaluateNotificationEvent only returns newly-created rows, so a lost send stayed pending until the 10-minute stranded-delivery sweep caught it. Route the sends through mapWithConcurrency at a bounded, exported NOTIFY_DELIVER_SEND_CONCURRENCY, same posture as the backfill-registered-repos fan-out: every send is attempted exactly once regardless of an earlier one's outcome, a failed send logs a structured notify_deliver_fanout_send_failed line naming the delivery, and any failures still fail the job afterward by throwing an aggregate error naming every lost delivery id.
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-31 09:04:50 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10140 +/- ##
==========================================
+ Coverage 79.95% 80.02% +0.06%
==========================================
Files 282 283 +1
Lines 58728 58936 +208
Branches 6930 6986 +56
==========================================
+ Hits 46958 47161 +203
- Misses 11480 11484 +4
- Partials 290 291 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
fix(queue): bound and isolate the notify-evaluate deliver fan-out
The notify-deliver enqueue after notify-evaluate ran through an unbounded
Promise.all over every resolved delivery (which can outnumber the batch's
events one-to-many across channels), rejected the whole fan-out on the
first send failure, and left the failure completely unlogged. A retry of
that job recovers nothing since evaluateNotificationEvent only returns
newly-created rows, so a lost send stayed pending until the 10-minute
stranded-delivery sweep caught it.
Route the sends through mapWithConcurrency at a bounded, exported
NOTIFY_DELIVER_SEND_CONCURRENCY, same posture as the backfill-registered-repos
fan-out: every send is attempted exactly once regardless of an earlier
one's outcome, a failed send logs a structured notify_deliver_fanout_send_failed
line naming the delivery, and any failures still fail the job afterward by
throwing an aggregate error naming every lost delivery id.
Closes #10022