diff --git a/backend/fluksio/flow/workers.py b/backend/fluksio/flow/workers.py index 12346bd..00b7d8e 100644 --- a/backend/fluksio/flow/workers.py +++ b/backend/fluksio/flow/workers.py @@ -391,6 +391,10 @@ class PythonWorkerPool: try: worker.send({**payload, "id": request_id}) except OSError as exc: + # A broken pipe is the truthful signal here: poll() still reports a + # child that has exited but not yet been reaped as alive, so + # _release would hand this corpse to the next call. Retire it. + worker.cancelled = True raise RemoteError(f"worker died: {exc}") from exc while True: @@ -433,6 +437,7 @@ class PythonWorkerPool: if line is None: worker.kill() raise NodeTimeout(f"was silent for {timeout}s and was killed") + worker.cancelled = True raise RemoteError("worker died") def compile(