You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Subtask]: D04 [baseline] Give taskRunner complete ownership of contexts on rejection and terminal completion #32282
Catalog ID: D04 Origin: B - Pre-existing in the 4.2 baseline and retained on main Evidence level: Reproduced resource retention
4.2 versus main: provenance
In 4.2, addToWait already creates WithCancelCause before queue admission, does not cancel rejected admissions, and removes only the map entry after normal completion. Main preserves both lifecycle gaps.
Design problem, impact, and existing responsibility
The parent context lives with the task runner. Deleting the running-map entry does not remove the parent cancelCtx.children reference. Cancellation in the heartbeat InvalidTask branch cannot reliably cover tasks already completed and removed. Retention grows with completed and rejected admissions.
Acceptance criteria
Contexts reach effective release after success, failure, rejected admission, exhausted retries, cancellation, and shutdown.
Use minimal behavioral/lifecycle regression tests; do not turn the diagnostic reflection of private cancelCtx fields into maintained tests.
Do not add a periodic sweeper for ownerless contexts. Preserve necessary completion and retry work.
Describe implementation you've considered
The creating taskRunner should cancel its context on rejection and at the actual terminal stage. Distinguish execution, retry, and completion acknowledgement so necessary completion SQL is not cancelled prematurely. Cleanup must not depend on a later heartbeat happening to observe the task.
Additional information
Existing investigation and validation limits
A probe follows production admission, result handoff, doTaskDone, and removal: after 1,000 completions or 1,000 rejected admissions, running=0 but the parent retains 1,000 children. Explicit terminal cancellation retains zero, and parent cancellation releases all. Normal and 100 race repetitions confirm this. Counts are not extrapolated into production RSS or inevitable OOM.
The named probes are local diagnostic overlays, not committed repository tests. Their names identify the investigation; they cannot be selected directly from an ordinary checkout. Implement the smallest maintained contract regressions and reuse relevant CI/validation proportionally. Temporary evidence commits are not required.
changed the title [-][Subtask]: D04 [base] 由 taskRunner 统一释放拒绝及终态任务的自建 context[/-][+][Subtask]: D04 [baseline] Give taskRunner complete ownership of contexts on rejection and terminal completion[/+]on Nov 5, 2026
Activity
[-][Subtask]: D04 [base] 由 taskRunner 统一释放拒绝及终态任务的自建 context[/-][+][Subtask]: D04 [baseline] Give taskRunner complete ownership of contexts on rejection and terminal completion[/+]fix(taskservice): unblock async completion on runner shutdown (#33040)