Skip to content

fix(conformance): exit the soak when it finishes and record its status - #145

Merged
sinameraji merged 1 commit into
mainfrom
fix/soak-exit-and-report
Nov 2, 2026
Merged

sinameraji merged 1 commit into
mainfrom
fix/soak-exit-and-report

Conversation

@sinameraji

Copy link
Copy Markdown
Collaborator

Refs #114. This does not close the issue: the 14-day run is still the gate.

What this does

Fixes a harness defect that would have hidden a finished run. soak.js kept its setInterval timers and its WebSocket reconnect loop alive after writing the final report, so the process never exited. Under the documented docker run -d --restart unless-stopped, a completed 14-day soak would have stayed Up forever and looked identical to a running one. The runner now clears its timers, closes the sockets, stops the engine and SeaweedFS, and exits 0. It exits 0 on purpose: a non-zero exit would make the restart policy start the finished soak again.

Fixes the restart check after a fault. injectFault's recovery path tested engine?.exitCode !== null, but a child killed by a signal has a null exitCode, so an engine that died during a fault was never restarted. It now checks both exitCode and signalCode.

Records the soak. New docs/conformance/soak.md covers what the harness checks, how to run the 14-day soak on a Linux host with a dedicated small disk, what to record, and the current status. docs/conformance/results.md links to it.

Validation run

Two 0.5-hour runs (SOAK_DAYS=0.02, faults every 2 minutes) on macOS arm64 under Docker Desktop against serverless-objects 0.13.6. The second run's artifacts are committed as docs/conformance/soak-validation-2026-11-02.{json,md}:

  • 0 violations, 24 verifications, 31,802 acknowledged writes, 62 failed (not acknowledged) writes
  • 497 socket echoes, none missed outside a fault
  • faults: kill9 3, sigterm 3, wipe-restore 2, crash-thread 2; the first run also injected bucket-outage
  • both wipe-restore faults lost nothing acknowledged and excused nothing, as durable mode should
  • engine RSS 203 MB and 225 open files at both ends; write p99 29 ms
  • disk-full skipped in both runs (the data directory was not its own small disk)

The container now exits cleanly at the end of a run, which is how the exit fix was verified.

Still open

The 14-day run itself. It needs a Linux host that stays up, with the data directory on its own filesystem of 8 GB or less so disk-full runs. The procedure and the fields to record are in docs/conformance/soak.md.

The runner kept its timers and sockets alive after writing the final report,
so a completed soak never exited: with --restart unless-stopped the container
stayed up forever and a finished run looked like a running one. Clear the
timers, close the sockets, stop the engine and the bucket, and exit 0 (a
non-zero exit would make the restart policy start the finished soak again).

Also treat a signal-killed engine as dead when deciding whether to restart
after a fault: a child killed by a signal has a null exitCode, so the old
check never restarted it.

Record the harness validation run and the 14-day procedure in
docs/conformance/soak.md, with the run's report.json and daily report.

Co-authored-by: autopilot <kimiflare@proton.me>
Signed-off-by: Sina Meraji <sina.meraji@gmail.com>
@sinameraji
sinameraji marked this pull request as ready for review November 2, 2026 09:05
@sinameraji
sinameraji merged commit 6627443 into main Nov 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant