Skip to content

feat: nack & message retry (story 2.3)#14

Merged
vieiralucas merged 4 commits intomainfrom
feat/2.3-nack-message-retry
Feb 12, 2026
Merged

feat: nack & message retry (story 2.3)#14
vieiralucas merged 4 commits intomainfrom
feat/2.3-nack-message-retry

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Feb 12, 2026

Summary

  • Implement handle_nack() in scheduler: increments attempt_count, clears lease, removes lease_expiry, re-adds fairness key to DRR active set
  • Wire SchedulerCommand::Nack with conditional drr_deliver_queue on success
  • Add gRPC nack handler in service.rs (same pattern as ack)
  • Add IntoStatus mapping for NackError

Acceptance Criteria Coverage

  • AC#1: attempt_count incremented ✓
  • AC#2: message re-enters ready pool via DRR active set ✓
  • AC#3: lease deleted from leases CF ✓
  • AC#4: lease_expiry entry deleted ✓
  • AC#5: atomic WriteBatch for all mutations ✓
  • AC#6: nack unknown message returns NOT_FOUND ✓
  • AC#7: immediate requeue, no max attempt limit ✓
  • AC#8: integration test verifies enqueue → lease → nack → lease → verify attempt_count ✓

Tests

Test plan

  • All 80 tests pass (79 + 1 ignored)
  • Clippy clean
  • CI passes

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.

  • New Features
    • Scheduler handle_nack: increments attempt_count, clears leased_at; atomically updates message and deletes lease + lease_expiry.
    • DRR: re-adds fairness key; calls drr_deliver_queue only if nack succeeds for instant redelivery.
    • gRPC nack handler with input validation, tracing, and NackError→Status mapping.
    • Idempotent: unknown or double nacks return NOT_FOUND; immediate requeue; no max attempts.

Written for commit 29722a5. Summary will update on new commits.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

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)
@vieiralucas vieiralucas force-pushed the feat/2.3-nack-message-retry branch from b319dbb to 29722a5 Compare February 12, 2026 17:03
@vieiralucas vieiralucas merged commit 37ac7df into main Feb 12, 2026
4 checks passed
@vieiralucas vieiralucas deleted the feat/2.3-nack-message-retry branch February 12, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant