taskDispatcher counts submitted tasks that haven't taken a slot yet (waiting). hasRoom() is true when limit <= 0 or active + waiting < limit.
claimRequeued and the NATS fetch loop in drainNATS both stop when there's no room. The rest of the backlog stays unclaimed in the store, or unfetched in the stream, until a later pass. There's still no per-claim poll wait, so the watchdog fix from 49d7619 is kept.
A run waiting on a callee gives its slot back, so the callee still finds room and can't deadlock.
Deletes the empty dispatcher.go and identity.go stubs.
Checked against the issue's open questions:
The worktree is created inside process, after the slot is taken. Claimed-but-waiting tasks never allocated disk, so this PR doesn't explain the disk growth. Look at volume cleanup (cleanupExpiredStorage runs only at startup) next.
A max_concurrency of 0 means unlimited. Check the deployed value.
Test: TestDrainPassClaimsOnlyWhatTheDispatcherCanRun runs 10 queued tasks with a limit of 2. One pass claims 2. It failed before the fix (all 10 were claimed). task check passed locally.
Still to do after deploying: unclaim or requeue the tasks currently claimed, and prune orphaned worktrees and volumes.
Fixes #1797.
- `taskDispatcher` counts submitted tasks that haven't taken a slot yet (`waiting`). `hasRoom()` is true when `limit <= 0` or `active + waiting < limit`.
- `claimRequeued` and the NATS fetch loop in `drainNATS` both stop when there's no room. The rest of the backlog stays unclaimed in the store, or unfetched in the stream, until a later pass. There's still no per-claim poll wait, so the watchdog fix from 49d7619 is kept.
- A run waiting on a callee gives its slot back, so the callee still finds room and can't deadlock.
- Deletes the empty `dispatcher.go` and `identity.go` stubs.
Checked against the issue's open questions:
- The worktree is created inside `process`, after the slot is taken. Claimed-but-waiting tasks never allocated disk, so this PR doesn't explain the disk growth. Look at volume cleanup (`cleanupExpiredStorage` runs only at startup) next.
- A `max_concurrency` of 0 means unlimited. Check the deployed value.
Test: `TestDrainPassClaimsOnlyWhatTheDispatcherCanRun` runs 10 queued tasks with a limit of 2. One pass claims 2. It failed before the fix (all 10 were claimed). `task check` passed locally.
Still to do after deploying: unclaim or requeue the tasks currently claimed, and prune orphaned worktrees and volumes.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #1797.
taskDispatchercounts submitted tasks that haven't taken a slot yet (waiting).hasRoom()is true whenlimit <= 0oractive + waiting < limit.claimRequeuedand the NATS fetch loop indrainNATSboth stop when there's no room. The rest of the backlog stays unclaimed in the store, or unfetched in the stream, until a later pass. There's still no per-claim poll wait, so the watchdog fix from49d7619is kept.dispatcher.goandidentity.gostubs.Checked against the issue's open questions:
process, after the slot is taken. Claimed-but-waiting tasks never allocated disk, so this PR doesn't explain the disk growth. Look at volume cleanup (cleanupExpiredStorageruns only at startup) next.max_concurrencyof 0 means unlimited. Check the deployed value.Test:
TestDrainPassClaimsOnlyWhatTheDispatcherCanRunruns 10 queued tasks with a limit of 2. One pass claims 2. It failed before the fix (all 10 were claimed).task checkpassed locally.Still to do after deploying: unclaim or requeue the tasks currently claimed, and prune orphaned worktrees and volumes.