feat: nack & message retry (story 2.3)#14
Merged
vieiralucas merged 4 commits intomainfrom Feb 12, 2026
Merged
Conversation
Base automatically changed from
feat/2.1-deficit-round-robin-scheduler
to
main
February 12, 2026 16:31
story 2.3: nack & message retry - add handle_nack() to scheduler: increments attempt_count, clears lease, re-adds fairness key to DRR for immediate redelivery - wire SchedulerCommand::Nack with drr_deliver_queue after nack - implement grpc nack handler with input validation - add IntoStatus mapping for NackError - 4 integration tests: requeue with attempt count, lease removal, unknown message not_found, full nack-then-ack lifecycle
- guard drr_deliver_queue with result.is_ok() after nack (M1) - add lease_expiry CF assertion to nack test (M2) - simplify serialization error via StorageError::from (L3) - add #[instrument] to gRPC nack handler (L4) - add double_nack_returns_not_found idempotency test (L5)
b319dbb to
29722a5
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
handle_nack()in scheduler: increments attempt_count, clears lease, removes lease_expiry, re-adds fairness key to DRR active setSchedulerCommand::Nackwith conditionaldrr_deliver_queueon successservice.rs(same pattern as ack)IntoStatusmapping forNackErrorAcceptance Criteria Coverage
Tests
nack_requeues_message_with_incremented_attempt_count(AC#1, ci: add ci/cd pipeline and dockerfile (story 1.2) #2, feat: consumer lease streaming & message delivery (story 1.7) #7, feat: message ack with atomic cleanup (story 1.8) #8)nack_removes_lease_and_lease_expiry(AC#3, feat: broker core with single-threaded scheduler loop #4, feat: grpc server with queue management rpcs #5)nack_unknown_message_returns_not_found(AC#6)nack_then_ack_completes_message_lifecycle(full lifecycle)double_nack_returns_not_found(idempotency)Test plan
Summary by cubic
Adds negative acknowledge (nack) with immediate retry: nacked messages are requeued with attempt_count incremented and lease + lease_expiry cleaned up. Exposes a gRPC nack endpoint and wires DRR to redeliver on success; Story 2.3 is complete.
Written for commit 29722a5. Summary will update on new commits.