Repository navigation
Labels
BugIncorrect Behavior
Description
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
controlscenario ofreproduce-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 allexits with code0; 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).
Metadata
Metadata
Assignees
Labels
BugIncorrect Behavior
Activity
Merge #2421: docs(issues): add specs for SI-22 shutdown event drainin…
Merge #2545: refactor(statistics): [#2536] hide the statistics reposi…
docs(issues): [#2410] refresh stale SI-22 spec text before #2414
docs(issues): [#2413] record the Task Reviewer re-review and fix its …
Merge #2569: docs(issues): close the #2413 delivery gates and refresh…
docs(events): [torrust#2414] state the measured cost of the per-event…
docs(pr-reviews): [torrust#2414] record the audit of Copilot's review…
test(tracker-core): [torrust#2414] make TestEnv own, stop, and join i…
docs(issues): [torrust#2414] record the red evidence of the T3a and T…
feat(events): [torrust#2414] add try_recv, len, TryRecvError, and the…
fix(tracker-core): [torrust#2414] drain the persistent listener's que…
17 remaining items
chore(issues): archive closed issue #2414 spec to docs/issues/closed
Merge #2587: chore(issues): archive closed issue #2414 spec to docs/i…
docs(issues): [#2415] move misplaced SI-22 progress-log entry into th…
docs(issues): [#2415] record the maintainer's push and acceptance-rev…
Merge #2591: refactor(bootstrap): [#2415] give each application compo…
test(http-core): [#1349] pin the event label contract and connection …
Merge #2593: test(http-core): [#1349] pin the event contract and the …
Merge #2598: chore(issues): archive closed issue #2415 spec to docs/i…
Merge torrust#2612: docs(skills): [torrust#2603] teach write-unit-tes…
Merge torrust#2578: fix(events): [torrust#2414] drain listener queues…
docs(issues): [torrust#2603] record the maintainer's push and accepta…
docs(shutdown): [#2416] record the independent review and the impleme…
Merge #2623: fix(bootstrap): [#2416] stop event producers before even…
Merge #2632: chore(issues): archive closed issue #2416 spec to docs/i…
Merge #2633: chore(issues): [#2410] close sub-EPIC SI-22 and archive …