Repository navigation
fix(pool): completion record for an unparseable spec; correct the reconcile-loop claim (#1149) - #1235
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…correct the reconcile-loop claim (#1149) A pooled task whose staged spec failed to parse was acked with no completion record, so spawn task status reported it unknown forever. The worker now validates the spec before running it and, for one that fails, writes a failed record (exit_code -1, retry_class spec_error, not retryable) at the key task status reads, then acks. A spec that is valid JSON can still name its results_prefix, which is honoured. The pooled-execution design doc and pkg/taskpool comments no longer claim a reconcile loop tops the pool up or replaces reclaimed Spot workers: pool create reconciles once. The queue's visibility-timeout comment no longer says it is sized from the TTL.
scttfrdmn
force-pushed
the
fix/1149-pool-leftovers
branch
from
October 20, 2026 19:50
dd91b73 to
fe08414
Compare
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.
Fixes #1149
What was left on main
The visibility-timeout comment in
cmd/pool.gowas already fixed in v0.136.0, butpkg/taskpool/queue.go'sCreateQueuedoc still said "The caller sizes it from the task TTL", so I fixed that too. The other two items were still open.Changes
Worker.runOnenow runstaskproto.ParseSpecbeforeExec. If the spec fails to parse (malformed JSON, failed validation, or an unknown field), the worker writescompletion.jsonand.exitcodeitself and then acks. The record hasstatefailed,exit_code-1 (the terminal-flush hook's "never returned a status") andretry_classspec_error. The record goes to the keytask statusreads:spawn-results-<account>-<region>/tasks/<task_id>/, or the spec'sresults_prefixif it is valid JSON and sets one.spec_error, not retryable. It's additive likeinstance_health(task run: a container task at default sizing fails, because Docker's install is OOM-killed on t4g.nano (and is classified app_error) #1180) and listed in the adapter RFC.staging_errorwould have been wrong: it means an input S3 copy failed.spored pool-workerwiresResults/AccountID/Regionthrough a newnewPoolWorker.docs/pooled-task-execution-design.md§2, §4 and §7: as shipped, provisioning is one-shot. There is no top-up and reclaimed Spot workers are not replaced. What survives a lost worker is its task, which SQS redelivers. The comments inqueue.goandworker.goare corrected to match, andrunOne's doc now says plainly that an execer error after parsing writes no record.Gates (each watched failing against a compiling revert)
TestWorker_UnparseableSpecWritesFailedRecordBeforeAckuses a fake queue and a fake results store, with three bad-spec shapes. Reverting withif _, perr := ParseSpec(...); false && perr != nilmade it fail: the execer ran and nothing was written. Swapping the record and the ack also made it fail ("record written with 0 message(s) on the queue, want 1").TestWorker_UnparseableSpecHonoursResultsPrefixfailed under the same revert.TestWorker_UnparseableSpecAckedEvenIfRecordWriteFailschecks the cost-leak property.TestNewPoolWorker_WiresTheResultsWriter(cmd/spored) failed withResults: nil.TestFakeFetcherDefaultParses: the old default fixture{"task_id":"x"}doesn't parse, and would have quietly routed every existing worker test down the new path, making their execer assertions vacuous.Checks
make checkpasses exceptcheck-build-tags, which also fails on unmodified main because of /private/tmp paths. golangci-lint (root,--allow-parallel-runners, since another agent held the lock) reports 0 issues; semgrep is clean;make api-snapshotis committed (additive only). No help text changed.Not run on AWS.