Skip to content

0.121.0: task status / --wait never read the completion record, so every successful task reports running then times out at TTL (record is valid and at the printed key) #715

Closed

Description

@scttfrdmn

Symptom

spawn task status and spawn task run --wait never find a completion record, even though the record exists, is valid, and is at exactly the path spawn printed at launch. --wait therefore polls until TTL and exits 1 on a task that succeeded in 50 seconds.

spawn 0.121.0, us-west-2.

✅ Task launched: cookbook-polish-align-r2
Instance:     i-0297ab55af9f47182  (c8g.large) in us-west-2 / us-west-2b
Run ID:       643c4c73-0b67-46fe-92f8-aae906a0c366
Completion:   s3://spawn-results-942542972736-us-west-2/tasks/cookbook-polish-align-r2/completion.json
Waiting for completion (polling every 15s)...
timed out waiting for task "cookbook-polish-align-r2" completion record (past TTL); poll later with 'spawn task status cookbook-polish-align-r2'
[exited with code 1]

The task was fine. All six declared outputs staged, the instance self-terminated, and the record at that exact key says so:

$ aws s3 ls s3://spawn-results-942542972736-us-west-2/tasks/cookbook-polish-align-r2/
   1 .exitcode
11069 command.log
  337 completion.json

$ aws s3 cp s3://.../tasks/cookbook-polish-align-r2/completion.json -
{
    "task_id": "cookbook-polish-align-r2",
    "run_id": "643c4c73-0b67-46fe-92f8-aae906a0c366",
    "exit_code": 0,
    "state": "completed",
    "started_at": "2026-10-05T15:17:14Z",
    "ended_at": "2026-10-05T15:18:04Z",
    "logs": ["s3://.../tasks/cookbook-polish-align-r2/command.log"],
    "retry_class": ""
}

And yet:

$ spawn task status cookbook-polish-align-r2
Task cookbook-polish-align-r2: running (no completion record yet)

state: "completed", exit_code: 0, matching run_id — reported as running.

It is not specific to this task, which I think narrows it

Two unrelated tasks from earlier sessions behave identically — their records are present and equally unreadable now:

$ spawn task status xarch-gatk4-arm64-t1
Task xarch-gatk4-arm64-t1: running (no completion record yet)
$ aws s3 ls s3://.../tasks/xarch-gatk4-arm64-t1/completion.json
  277 completion.json

$ spawn task status xarch-of-scaled-arm64-r1
Task xarch-of-scaled-arm64-r1: running (no completion record yet)
$ aws s3 ls s3://.../tasks/xarch-of-scaled-arm64-r1/completion.json
  285 completion.json

So it is the read path, not the write path, and it affects every task I can test. The write path is demonstrably correct — spawn prints the key and the object is there.

I believe this is a regression rather than long-standing: --wait worked in earlier sessions on this same account and bucket (I have notes on its behaviour, including a stale-record-on-same-task_id-reuse quirk, which required it to be reading records at all). The older records above were written by older spawn versions and are unreadable by 0.121.0.

Why it matters more than the exit code

Two of this project's hard rules interact badly with it:

  1. --wait is how a recipe is driven. make run wraps task run --wait, so every successful task now appears to fail and blocks for the full TTL. On a 25-minute TTL that is 25 minutes of wall time per task to learn nothing.
  2. It inverts the "never trust an exit code" discipline. This project's rule is that exit 0 is not evidence of success — so a smoke check runs inside the task and the bucket is checked afterwards. That discipline is what let me notice this at all: the exit code said failure, the outputs said success, and the outputs were right. But an operator who trusts --wait would now conclude a working recipe is broken, and anyone retrying would pay twice.

What I did instead, in case it is useful as a workaround

Dropped --wait entirely and polled the output bucket for the declared outputs. That costs nothing extra — the instance self-terminates on completion either way — and it is strictly more trustworthy than a completion record because it checks the artifacts rather than a status field.

Reproduce

spawn task run --spec any.task.json --wait     # succeeds in seconds, --wait times out at TTL, exit 1
aws s3 ls   s3://spawn-results-<acct>-<region>/tasks/<task_id>/   # completion.json is present
spawn task status <task_id>                    # "running (no completion record yet)"

Happy to run anything diagnostic against this account — I have several tasks in this state and they are cheap to re-create.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions