Admitted workloads are requeued too early when a worker disconnects An admitted workload…
- User
Admitted workloads are requeued too early when a worker disconnects
An admitted workload must remain ready during a temporary worker disconnect and be retried only after the configured worker-loss timeout. Reconnection with the same configuration must restore processing without affecting other connected workers.
Interface
No new interfaces are introduced.
- Assistant
I’ll implement this directly. Note: use of
AGENTS.mdis experimental and carries no backward- or forward-compatibility guarantees; per the task instructions, I’m treating that disclaimer as acknowledged and proceeding autonomously. I’ll first trace worker disconnect handling and the configured loss timeout, then patch and run focused tests. - Assistant
rgisn’t installed in this checkout, so I’m using targetedfind/grepsearches instead. The first pass will identify the worker protocol and timeout ownership before any edits. - Assistant
The failure path is now clear: the timeout is measured from when the workload became Ready, not when its assigned worker disconnected. That makes long-running admitted workloads flip to Retry immediately; additionally, when every worker is reconnecting, reconciliation exits before applying the grace period. I’m patching connection state to retain the actual loss time and using it for both partial- and total-disconnect cases.
- Assistant
The first focused test attempt hit the container’s process limit during Go compilation (fork failures), not a code/test failure. I’m rerunning with constrained build parallelism and will then inspect concurrency behavior and the exact production diff.
- Assistant
I tightened the connection-state transition to avoid a race where reconciliation could observe “disconnected” before the loss timestamp existed. Newly observed reconnecting clients now start the grace period on first observation, while real watch loss records the precise disconnect time; successful reconnection clears that state before becoming available again.
- Assistant
The focused package tests now pass with constrained parallelism, and whitespace validation passes. Per the repository’s
AGENTS.md, I’m applying its code-change review checklist to the final diff before the last verification.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.