Repository navigation
Pooled task execution: worker pool for wide fan-out (#70 Phase 1) - #456
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
…ipt (no self-terminate) (#70 P1)
scttfrdmn
force-pushed
the
feat/70-pooled-workers
branch
from
July 31, 2026 02:41
afe6c7f to
a624b12
Compare
scttfrdmn
added a commit
that referenced
this pull request
Jul 31, 2026
The spawn pool command (#456) was added without regenerating docs-gen/; the missing untracked docs-gen/pool.md put the tree in a dirty state that failed GoReleaser's git-state check on the v0.96.0 tag. Regenerated via make gen-docs.
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 1 of the pooled-execution work for nf-spawn#70 (design: spawn#454). Runs a wide fan-out as a pool of fungible worker instances draining a shared queue instead of one ephemeral instance per task — fixing both the dispatch bottleneck and the per-task instance-boot tax (Little's Law) that cap concurrency today.
History note (please read)
The two foundational packages —
pkg/taskcohortandpkg/taskpool/{queue,worker}— were accidentally swept ontomainby the squash-merge of PR #455 (ttl-reaper), which bundled files from my in-flight branch. That code is correct and already onmain; it's just mislabeled under an unrelated commit. Per the "land it forward, no history rewrite" decision, this PR adds only the remaining pool work on top (executer, spec store, submitter, CLI, worker command). Net result onmainis the same complete feature; the only artifact is #455's message understating its diff.What this PR adds
pkg/taskpool(rest):ScriptExecer(runs each job via the taskproto stage/run/complete protocol),DirWorkspace(clean per-task workspace — the Server-side TTL reaper: out-of-band backstop so a spore can never outlive its deadline (even if spored is dead) #70 isolation-on-reuse gotcha),SpecStore(S3 spec staging/fetch),Pool(submitter: create queue → stage+enqueue → drain).pkg/taskproto:GeneratePooledJobScript— thespawn task runwrapper minus the/tmp/SPAWN_COMPLETEself-terminate signal, so a worker survives to run the next task. A test asserts it's byte-identical to the wrapper except that block. AlsoParseSpec([]byte).spawn pool create|submit|status|drain(submitter) +spored pool-worker(the on-instance pull loop).createprovisions workers as aPartialCohort(best-effort/eventual — ask N, accept--min-viable) viapkg/taskcohort.Semantics
spawn:pool-run-id/spawn:role=pool-worker) backstops a missed drain.NewPartialCohort+ the taskcohort seam express every pool semantic.Testing (no paid AWS)
pkg/taskcohort: 4 tests drive cohort's real reconciler (all-up, best-effort-degrades, per-entity AZ fallback, classifier).pkg/taskpool: worker-loop unit tests (fake SQS + injected clock, green under-race); queue + full submit→pull→run→drain end-to-end tests against real Substrate SQS + S3.poolclassified);sporedCLI test updated.go build ./...clean.The
spawn poolCLI launch path itself needs real EC2 (Tier 2/3) — that live validation is Phase 2 (nf-spawn integration + the real N=108 run).Refs nf-spawn#70. Design:
docs/pooled-task-execution-design.md(spawn#454).