Repository navigation
Non-blocking task dispatch so wide fan-outs launch in parallel (#70) - #75
Merged
Merged
Conversation
This was referenced Jul 31, 2026
scttfrdmn
added a commit
that referenced
this pull request
Jul 31, 2026
Ships pool mode (spawn.pool, #76) + non-blocking dispatch (#75) in a release. Also a post-audit doc refresh: 'How it works' now describes spawn task run + durable S3 completion (not the stale spawn launch/spored complete); pool section requires spawn >= v0.97.0; design docs marked shipped/implemented; runbook pins >= v0.97.0 and fixes the run-id derivation; version pins bumped to 0.10.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes
SpawnTaskHandler.submit()non-blocking. It previously blocked onlaunchProcess.waitFor(), which serialized every launch on Nextflow's single task-monitor thread (~3s each). On a real N=108 fan-out that meant ~5m44s just to dispatch and a peak of ~60 concurrent instances — never 108.Now
submit()startsspawn task runand returns immediately; the launch round-trips overlap.How
redirectErrorStream) — required so the OS pipe buffer can't fill and wedge the subprocess —waitFor()s, and publishesvolatile launchDone/launchExit/launchOutput(launchDonewritten last, establishing happens-before for the other two). It deletes the spec file only after the process exits (spawn has read it by then).checkIfRunning()returnsfalsewhile!launchDone("still dispatching"), then throwsAbortOperationExceptionon a non-zero exit (surfacing a launch failure), else proceeds to the existing RUNNING probe.Why it's safe (verified against Nextflow 26.04.3 bytecode)
TaskPollingMonitor.checkTaskStatuswrapscheckIfRunning()/checkIfCompleted()in try/catch →handler.kill()+handleException()— the standard terminal task-failure path. Moving the launch-failure throw fromsubmit()tocheckIfRunning()therefore fails the task exactly as before.killTask()runsspawn terminateby taskId, a no-op when nothing launched, so this stays leak-safe (cost safety is existential).finallyalways setslaunchDone, andisSubmitTimeout()is a further backstop, so a task can't wedge in SUBMITTED.Scope
This overlaps dispatch; it does not fix the per-task instance-boot tax (Little's Law) — peak concurrency improves but is still capped until pooled workers land. This is Phase 0 of the plan in spawn
docs/pooled-task-execution-design.md; the deeper fix is the pooled-worker design (spawn Phase 1).Testing
Compiles (JDK17) and the full Spock suite is green. The suite is all static-helper tests (the handler needs a real
TaskRun;@CompileStaticmakesProcess/TaskRunmocking heavy), so the concurrency behavior itself is validated at the Phase 2 real N=108 run, not in unit tests.Refs #70.