Skip to content

Drain listener queues on shutdown #2414

Closed

Description

@josecelano

Parent: #2410 (SI-22 sub-issue 2 of 4; part of #1488).

Goal

When an event listener is cancelled, it processes the events already in its queue until the queue is empty or its drain timeout expires, logs how many it processed, and warns with the number left when the timeout cuts the drain short (D1).

Acceptance criteria

  • AC1 (sub-EPIC AC1): a listener cancelled with events already queued processes all of them when the finite backlog fits its budgets and no lag or handler failure occurs, then returns Cancelled (all seven components).
  • AC2 (sub-EPIC AC3): each listener logs the number of events processed after cancellation, and warns with the listener name and leftover count when its drain timeout expires.
  • AC3 (sub-EPIC AC4): the drain timeout default is chosen from a recorded release measurement. It bounds admission between events, not handler completion; shared-deadline escalation and producer-budget starvation remain explicit exceptions, covered in sub-issue 4.
  • AC4 (sub-EPIC AC6): the seven it_should_prioritize_* tests are replaced by tests of the new policy.
  • AC5 (sub-EPIC AC11): the package-level integration test is proven red against the cancel-first loop and green after the fix.
  • AC6: the control scenario of reproduce-lost-completions.sh, rerun with the T0 parameters, loses no completion.
  • AC7 (sub-EPIC AC12): the drain timeout is checked only between events. A test shows a slow handler crossing this timeout still completes before the drain stops. Shared-deadline abort remains an explicit exception, verified with supervisor coverage in sub-issue 4; a received event is not included in the receiver's leftover count.
  • linter all exits with code 0; relevant tests pass.

Specification: docs/issues/open/2414-2410-si-22-2-drain-listener-queues-on-shutdown/ISSUE.md (added by the spec-only PR).

Activity

  1. added
    Bug
    on Oct 2, 2026
  2. added a commit that references this issue on Oct 2, 2026
  3. added theissue type on Oct 13, 2026
  4. added 4 commits that reference this issue on Oct 16, 2026
  5. self-assigned this
    on Oct 20, 2026
  6. added 6 commits that reference this issue on Oct 20, 2026
  7. 17 remaining items

  8. added 9 commits that reference this issue on Oct 20, 2026
  9. added 2 commits that reference this issue on Oct 21, 2026
  10. added 4 commits that reference this issue on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Bug

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions