fix(server): return 503 on full Slack queue instead of acking-and-dropping (#356)#375
Open
gnanirahulnutakki wants to merge 1 commit into
Open
fix(server): return 503 on full Slack queue instead of acking-and-dropping (#356)#375gnanirahulnutakki wants to merge 1 commit into
gnanirahulnutakki wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…pping (#356) Inbound Slack messages were silently dropped when the bounded worker queue was saturated, yet Slack still received a 200 ack and never retried — silent data loss under burst. Root cause: AppState::enqueue collapsed mpsc TrySendError::Full and Closed into a single bool (try_send(...).is_ok()), and slack_events returned StatusCode::OK regardless of the drop. This is asymmetric with /chat, which already surfaces QueueFull as 503. Fix: enqueue now returns a three-way EnqueueOutcome { Accepted, Full, WorkerGone }. slack_events acks 200 only on Accepted and returns 503 SERVICE_UNAVAILABLE on Full and WorkerGone, so Slack redelivers instead of treating the message as received. Mirrors the /chat full-queue path. Adds a regression test (enqueue_distinguishes_full_queue_from_a_gone_worker) that fills a capacity-1, undrained queue and asserts Full is reported distinctly from WorkerGone. Verification: cargo test -p ardur-server, cargo test -p ardur-e2e-tests, cargo clippy -p ardur-server --all-targets -D warnings, cargo fmt --check — all green. Fixes #356 Checkpoint: architect/sessions/fix-356-slack-full-queue-2026-07-23/journal.md Signed-off-by: GR <gnanirn@gmail.com>
gnanirahulnutakki
force-pushed
the
fix/356-slack-full-queue-503
branch
from
July 23, 2026 18:42
94c7f17 to
e553c4d
Compare
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.
Summary
Fixes #356 — inbound Slack messages were silently dropped when the bounded worker queue was full, yet Slack still received a
200ack and never retried. Under burst (queue depth >WORKER_QUEUE_CAPACITY= 1024) real messages were lost with a misleading log, and the 2xx told Slack not to redeliver.Root cause
crates/server/src/state.rs—AppState::enqueuecollapsedmpsc::error::TrySendError::FullandClosedinto a single bool (try_send(...).is_ok()), erasing the retryable-vs-terminal distinction.crates/server/src/routes.rs—slack_eventslogged"turn worker is gone; dropping message"and returnedStatusCode::OKregardless of why the enqueue failed.This was asymmetric with the
/chatpath, which already surfaces a full queue as503.Fix
enqueuenow returns a three-wayEnqueueOutcome { Accepted, Full, WorkerGone }instead of a bool.slack_eventsacks200only onAccepted; on bothFullandWorkerGoneit returns503 SERVICE_UNAVAILABLEso Slack redelivers rather than treating the message as durably received. This mirrors the existing/chatQueueFull → 503behavior.Full/ break onClosed.Regression test
state::tests::enqueue_distinguishes_full_queue_from_a_gone_workerfills a capacity-1, undrained queue and asserts:AcceptedFull(retryable, not silently accepted, notWorkerGone)WorkerGoneThe test exercises the exact distinction the fix introduces; it does not compile against the old
boolAPI.Verification
All green locally (macOS, toolchain 1.96.1):
cargo fmt --checkcargo clippy -p ardur-server --all-targets -- -D warningscargo test -p ardur-server(incl. the new regression test)cargo test -p ardur-e2e-testsNot merged — left for peer review.