Repository navigation
Pooled execution mode (spawn.pool) for wide fan-out (#70 Phase 2) - #76
Merged
Merged
Conversation
scttfrdmn
force-pushed
the
design/70-pool-integration
branch
from
July 31, 2026 02:47
f173b6d to
fc24e1d
Compare
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.
Phase 2 of nf-spawn#70: wire nf-spawn to the spawn-side worker pool (spawn#456, Phase 1) so a wide fan-out runs as a pool of fungible workers draining a shared queue instead of one instance per task.
Stacked on #75 (non-blocking submit, Phase 0) — this branch includes that commit; merge #75 first, or merge this and #75 folds in. Design:
docs/pool-integration-design.md.The gap this closes
Phase 1 built the pool engine in spawn (
spawn pool create/submit/drain+spored pool-worker), but nothing told nf-spawn to use it. The blocker was "nf-spawn has no run-level lifecycle hook." Resolved: Nextflow exposesTraceObserverFactoryV2(a pf4jExtensionPoint) withonFlowCreate(Session)/onFlowComplete()— verified against the shipped 26.04.3 jar.What's here
SpawnPoolObserver(TraceObserverV2) +SpawnPoolObserverFactory(registered inbuild.gradleextensionPoints, alongsideSpawnExecutor):onFlowCreate→spawn pool create(provision workers + queue);onFlowComplete→spawn pool drain. Inert unlessspawn.pool.enabled.SpawnPoolConfig: reads thespawn.pool { … }block and derives a stable, SQS-name-safe run id fromsession.uniqueId— so the observer and everysubmit()agree on the queue without shared mutable state (the run id is a pure function of the session both hold).SpawnTaskHandler.submit()pool branch: builds the sameTaskSpec, thenspawn pool submit --run-id R --spec f.json(S3 stage + one SQS send — no launch) instead ofspawn task run.checkIfRunning/checkIfCompletedare unchanged — a pooled worker writes the same.exitcode/completion.json.killTask()is a no-op in pool mode (workers are shared; pool drains at run end / idle-timeout).Semantics (design §5)
PartialCohort(ask N, acceptminViable) — fewer workers ⇒ lower parallelism, never a failed run. A pool that can't reach min-viable aborts the run atonFlowCreate, before any task submits.onFlowCompleteon success and failure); workers idle-drain to $0; reaper + queue retention backstop a dead-head crash. Three independent teardown paths.ext.instanceTypeisn't honored in pool mode — documented; best for the wide uniform scatter.Testing
SpawnPoolTest: config parsing, run-id stability + SQS-safety, and thespawn pool create/drain/submitargv builders (pure/static,@CompileStatic, no AWS) — mirroring the existingbuildTaskRunCommand/buildTaskSpecargv tests. Plugin assembles;extensions.idxregisters both extensions.spawn.pool.enabled, TTL set, post-run terminate + leak-check. Success criteria: peak → N, dispatch → seconds, $0 after drain.Refs #70. Requires a spawn release carrying
spawn pool(spawn#456).