nullboiler icon indicating copy to clipboard operation
nullboiler copied to clipboard

BUG: run with no eligible worker waits silently forever (no fail-fast on permanent dead-end)

Open addadi opened this issue 3 months ago • 1 comments

Bug: run with no eligible worker waits silently forever (no fail-fast on permanent dead-end)

Summary

When selectWorker returns null, the engine treats every case identically: retry with backoff. It cannot distinguish:

  • transient backpressure — matching workers exist but are saturated → retrying is correct;
  • permanent dead-end — no active worker matches the tags at all (wrong tag, worker dead/drained, never registered) → retrying loops forever.

In the permanent case the run sits in running state indefinitely with no terminal failure, no surfaced error, and repeated retry log spam.

Root cause

src/dispatch.zig:37 selectWorker returns null for both conditions; the engine's retry loop has no way to ask "does any active worker ever match these tags?".

Reproduction

  1. Submit a run whose step requires worker_tags: ["nonexistent-tag"].
  2. Run never terminates; steps retry forever; /runs/{id} shows running with repeated attempts.

Expected behavior

A hasActiveWorkerForTags(tags)-style check (active status + tag intersection, ignoring load) distinguishes the two cases:

  • matching active worker exists but is saturated → keep retrying (backpressure);
  • no matching active worker → fail the run with a clear error ("no worker can serve node X (tags [...])").

This also matters for saturation policy: a single saturated worker with max_concurrent=1 should not be mistaken for a dead-end.

addadi avatar Aug 22 '26 09:08 addadi

Confirmed empirically during the #53 investigation (nullboiler v2026.5.29 + nulltickets v2026.3.2): after the workflow's dispatch started failing fast (wrong worker URL → HTTP 404), the task cycled retry-with-backoff for ~an hour, its backoff window growing while /tracker/status showed nothing actionable — and the stale task's claim cycles starved a freshly-created task on the same role for multiple poll ticks (/leases/claim served the oldest eligible task first). Both failure modes this issue describes: silent dead-end, and no distinction from transient backpressure. The named-error + dead-letter fail-fast proposed here would have cut the debug time substantially.

vernonstinebaker avatar Sep 28 '26 13:09 vernonstinebaker