diff --git a/worker/fluksio_worker/agent.py b/worker/fluksio_worker/agent.py index 210ad4d..f76e6d7 100644 --- a/worker/fluksio_worker/agent.py +++ b/worker/fluksio_worker/agent.py @@ -304,6 +304,10 @@ class Agent: while True: line = await loop.run_in_executor(None, worker.read_line) if not line: + # The pipe closes a moment before the exit status is + # there to read, and a signal is only told by the status. + with contextlib.suppress(subprocess.TimeoutExpired): + await loop.run_in_executor(None, worker.proc.wait, 1) await socket.send( json.dumps( {