Skip to content

Sync main with master#281

Merged
wool-labs[bot] merged 3 commits into
mainfrom
master
Jul 2, 2026
Merged

Sync main with master#281
wool-labs[bot] merged 3 commits into
mainfrom
master

Conversation

@wool-labs

@wool-labs wool-labs Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Auto-generated by the sync branches workflow.

conradbzura and others added 3 commits July 2, 2026 19:01
The worker driver task runs a coroutine that closes over its
DispatchSession, and the session holds the task in _worker_task, so the
session, its task, and the task's forked contexts form a reference
cycle that only the cyclic collector can reclaim. Under sustained
dispatch these accumulate between collections.

Clear _worker_task in the task's done-callback once the completion
future is settled, breaking the cycle so reference counting reclaims
the session and task as soon as the dispatch ends. The only reader
after completion, cancel, already tolerates a None task, and teardown
synchronizes on the separate completion future, so dropping the
reference is safe.
Drive a coroutine dispatch to natural completion and assert the worker
driver task is reclaimed, observed through a weakref that clears with
automatic collection disabled, so reference counting rather than a
cyclic pass frees it. Retain the finished session explicitly to prove
it no longer pins the task. The driver task is identified through its
coroutine name, as no public handle distinguishes it from an in-flight
step task on the worker loop.
@wool-labs wool-labs Bot merged commit e2c7be3 into main Jul 2, 2026
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