Skip to content

DLS v0.3.1 — pause/resume race fixed

Choose a tag to compare

@Jestions-dev Jestions-dev released this 10 Nov 04:52
· 2 commits to main since this release

What was broken

pause() then resume() on a job whose transfer had not finished unwinding left it stuck in paused forever.

Two writes raced:

  1. pause() parks the job as paused
  2. the aborted transfer's handler ran #stopAs(host_restart) and wrote paused again — over the queued state a concurrent resume() had just set
  3. the scheduler never saw a queued job, so nothing restarted

The fix

  • #run only parks a job that is still running
  • #stopAs refuses to touch a job nobody is running

How it was found

test/acceptance.test.mjs — the ten acceptance criteria from SPEC §12, written today against a real HTTP server and the real transport. Criteria 2–8 had no automated coverage until now; the race surfaced on the first honest run.

Tests

30 offline cases, 7 of them the SPEC acceptance list.

node --test      # 30 pass