Skip to content

Retry starting a worker before giving up - #215

Closed
maleadt wants to merge 1 commit into
mainfrom
tb/retry-worker-spawn
Closed

maleadt wants to merge 1 commit into
mainfrom
tb/retry-worker-spawn

Conversation

@maleadt

@maleadt maleadt commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

A worker that fails to start aborts the whole run: addworker is called outside the per-test try, so its error ends up in "Caught an error, stopping..." and every test still queued is reported as interrupted. Starting a worker can fail for reasons that have nothing to do with the tests. On oneAPI.jl's Aurora CI (62 workers on one node, with code coverage) a respawned worker missed Malt's hard-coded 30 s deadline for reporting its port:

nested task error: Worker process exited before we could connect. Stderr:
    nothing
caused by: Timeout

addworker now tries starting the process up to three times before rethrowing. Errors from init_worker_code still propagate right away, as they are deterministic.

The test uses a launcher as exename whose first start prints something other than a port, which fails the same way without waiting for the deadline. It fails without the change and passes with it.

JuliaPluto/Malt.jl#113 raises Malt's deadline to 60 s and makes it configurable, but it is unreleased, and this keeps runs from dying on a single slow start regardless of the deadline. That PR also fixes something PTR can't: Malt 1.4.1 leaves a process that timed out running, with no handle to stop it, so a failed attempt can leave a stray worker behind (as an aborted run already does today).

A worker that fails to start aborts the whole run, even though starting
can fail for reasons unrelated to the tests: on a heavily loaded system
(e.g. 62 workers on an Aurora node, with code coverage enabled) a worker
can miss Malt's 30 s deadline for reporting its port. addworker now
tries starting the process three times. Errors from init_worker_code
still propagate right away, as they are not transient.
@maleadt

maleadt commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator Author

Not sure we want this, alternatively we just wait for JuliaPluto/Malt.jl#113. More than 60s worker startup time is probably indicative of some other failure.

@giordano

Copy link
Copy Markdown
Collaborator

Not sure we want this, alternatively we just wait for JuliaPluto/Malt.jl#113. More than 60s worker startup time is probably indicative of some other failure.

Agreed on both points.

@maleadt

maleadt commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator Author

Malt 1.5 is released and has this.

@maleadt maleadt closed this Oct 25, 2026
@giordano
giordano deleted the tb/retry-worker-spawn branch October 25, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants