Repository navigation
Commit f65eb12
committed
fix(task): reserve a consumed drain submission through its durable ack
What: MessageQueueService gains claimMessage(id), and the pending-slot
consumption in Task.ask claims the entry when handing its ID to the
caller. Persistence already settles the reservation: removeMessage on
success, releaseMessage on failure/abort, and the ask abort/superseded
paths release the handed ID.
Why: the drain path releases its claim after submitting, and the
pending-slot consumption handed the ID back without claiming — so while
persistQueuedFeedbackAndAcknowledge retried (backoff can run seconds),
the entry sat unclaimed in the queue. A background drain (tracker
already cleared) or a second ask could claim it again, submitting and
persisting the same user message twice, with one ack failing after the
other removed the entry (CodeRabbit 4173559934).
Impact: the entry stays reserved from consumption until persistence
settles; the claim-path consumption was already reserved by its own
claim. Pin: interception -> claimNextMessage undefined and a second
drain no-ops while the ack is unsettled; a failed ack releases the
reservation for redelivery.1 parent ed89a6e commit f65eb12
3 files changed
Lines changed: 60 additions & 0 deletions
File tree
- src/core
- message-queue
- task
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
116 | 133 | | |
117 | 134 | | |
118 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2529 | 2529 | | |
2530 | 2530 | | |
2531 | 2531 | | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
2532 | 2538 | | |
2533 | 2539 | | |
2534 | 2540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
423 | 460 | | |
424 | 461 | | |
425 | 462 | | |
| |||
0 commit comments