Skip to content

A task that fills /tmp uploads a 0-byte completion.json and .exitcode; status then fails 'unexpected end of JSON input' and --wait never returns #1179

Closed

Description

@scttfrdmn

What happened (spawn 0.133.0, task cookbook-spades-real-assemble-1792380539): a container task filled the host /tmp tmpfs. SPAdes died at K77 with No space left on device. Spawn logged command exit rc=1 and stage-out completed, but the results prefix then held:

       0 .exitcode
  103652 command.log
       0 completion.json

spawn task status failed with parse completion record: unexpected end of JSON input, and spawn task run --wait never returned. The failure was recorded in command.log, but the record every consumer reads was empty.

Why (origin/main cfa8e5f):

  • pkg/taskproto/recorddir.go:28 puts the local record directory on /tmp, by design (spawn#66, shared with spored).
  • On a container task that /tmp is also the staging tmpfs, which the user command is free to fill.
  • The wrapper writes the record with cat > /tmp/spawn-completion.json <<JSON … JSON, and the same for .exitcode (pkg/taskproto/flush.go ~L150–168). With no space left, both files are truncated to 0 bytes.
  • The next line uploads them unconditionally: aws s3 cp … completion.json || true.

So a full disk turns a clean failure record into an unparseable one. That is the #561/#566 failure shape again: a task whose outcome the platform cannot report.

Suggestions, any of which closes it:

  1. Write the record somewhere the task cannot fill: a small reserved file pre-allocated at wrapper start, or a path outside the staging tmpfs that spored can still see.
  2. Validate the record before uploading it (non-empty, jq -e .). If it fails, fall back to a minimal record built in memory and piped to aws s3 cp - …, which needs no local disk.
  3. Make spawn task status / --wait treat an empty or unparseable completion.json as a failed task (with the command.log pointer), not a parse error that hangs the wait.

Found running SPAdes (whose work directory peaks at about 4× RAM) in scientific-codes-cookbook measurements/spades-real; the measurement now writes -o to the root disk.

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