fix(acp): notify the channel when a panicked batch is dead-lettered - #5709
fix(acp): notify the channel when a panicked batch is dead-lettered#5709EmminiX wants to merge 3 commits into
Conversation
|
the fix is right — the notice string is worth not duplicating though. |
Chessing234
left a comment
There was a problem hiding this comment.
checked the scope question: after this, lib.rs:3788 and this new branch are the only two production requeue() call sites — every other hit in the tree is a queue.rs test — so it closes the last path where a dead-lettered batch vanished without telling the channel.
wording lines up too: the existing template at :3823 is "
When an agent task panics, recover_panicked_agent requeued the batch and discarded the result. If that requeue exhausted the retry budget the batch was dropped with only a log line, so the channel went silent with no explanation. The non-panic path already posts a notice via spawn_failure_notice; this makes the panic path do the same. Threads the existing RestClient through recover_panicked_agent and drain_ready_join_results, and captures the dead-lettered batch that EventQueue::requeue already returns. Adds a test that fails without the change: it burns the retry budget, panics a task holding a recoverable batch, and asserts a request reaches a local listener standing in for the relay. Signed-off-by: Emanuel Covasa <e.covasa@gmail.com>
Exercise the real join-drain handoff, parse and verify the signed channel event, and pin retry and removed-channel no-notice behavior. Co-authored-by: Ravneet Arora <rarora@squareup.com> Signed-off-by: Ravneet Arora <rarora@squareup.com>
c9d8b37 to
876dab7
Compare
|
🤖 Follow-up implementation completed and pushed. I rebased the PR onto current The regression coverage now:
Mutation evidence:
Verification at exact head
The existing best-effort |
Signed-off-by: Emanuel Covasa <e.covasa@gmail.com>
|
Good catch on the duplication, thank you. Fixed in Added a One I deliberately left, so you do not have to ask: the hard-timeout notice still carries the same sentence with its reason inlined as The other two siblings are genuinely different sentences (one has no "after multiple retries" clause, the auth-failure one is a different remedy), so they stay as they are.
|
Summary
A panicking agent whose batch has already burned its retry budget now tells the channel, the same
way the non-panic path does. Before this the batch was discarded with only a log line, so the
channel went silent with no explanation.
EventQueue::requeuealready returns the dead-lettered batch andrecover_panicked_agentwasthrowing that return value away. This threads the existing
RestClientthroughrecover_panicked_agentanddrain_ready_join_resultsand reusesspawn_failure_notice, so thereis no new mechanism and no new dependency. The notice text follows the wording of the three
existing ones.
Closes #5708
Duplicate search
No open PR touches
recover_panicked_agentorspawn_failure_notice, and none matchespanictogether with
dead-letter.This is deliberately not another dead-session recovery fix. #5598 and others already work that
lane and I did not want to add noise to it. This is only the missing notification on the panic
path, which is a separate and much smaller hole.
Testing
New unit test
panic_dead_letter_posts_a_failure_notice:join_error.is_panic(), so it exercises the realpanic ingress rather than a cancellation
requeuedead-lettersTcpListenerin for the relay, then reads the request and asserts it isPOST /events, that it carries the dead-lettered channel id, and that it contains the reasontext, before returning a 200
Verification:
cargo test -p buzz-acp: 766 passed, 0 failed (plus 9 inpool_lifecycle_state)cargo clippy -p buzz-acp --all-targets -- -D warnings: cleancargo fmt --check: cleanRebased on current
mainand re-verified after#5682landed in this file.Logging
The dead-letter case now logs at WARN with
channel_idand the event count, matching the detaillevel of the requeue case beside it.