daemon: extract task bus and make slot waits cancellable #1932

Closed
opened 2026-11-12 16:35:18 +00:00 by sam · 1 comment
Owner

Move the task bus and dispatcher off Daemon, built in the constructor instead of sync.Once. reacquire and the wait on the previous run in a repo chain ignore ctx, so a cancelled run can hold or wait for a slot forever; select on ctx.Done().

Done when Daemon holds a pointer to it and both waits return on cancellation.

Move the task bus and dispatcher off Daemon, built in the constructor instead of sync.Once. reacquire and the wait on the previous run in a repo chain ignore ctx, so a cancelled run can hold or wait for a slot forever; select on ctx.Done(). Done when Daemon holds a pointer to it and both waits return on cancellation.
sam added the bughigh labels 2026-11-12 16:35:18 +00:00
Author
Owner

Done in 500d02be: the task bus and dispatcher are their own type, built in the constructor (no sync.Once). A run queued behind its repo chain, and a resumed run reacquiring capacity, now return on ctx cancellation and give back what they hold; TestCancelledRunQueuedBehindItsRepoReturns hung on the old code. reacquire gets the call-wait watcher's ctx, so only shutdown (not a per-task stop) interrupts it; filed separately. task check passed.

Done in 500d02be: the task bus and dispatcher are their own type, built in the constructor (no sync.Once). A run queued behind its repo chain, and a resumed run reacquiring capacity, now return on ctx cancellation and give back what they hold; TestCancelledRunQueuedBehindItsRepoReturns hung on the old code. reacquire gets the call-wait watcher's ctx, so only shutdown (not a per-task stop) interrupts it; filed separately. task check passed.
sam closed this issue 2026-11-12 17:17:54 +00:00
sam added a new dependency 2026-11-13 02:50:57 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#1932