Skip to content

fix(daemon): a running job is a start in progress, not a service that is ready - #573

Merged
7schmiede merged 2 commits into
mainfrom
fix/job-running
Nov 18, 2026
Merged

7schmiede merged 2 commits into
mainfrom
fix/job-running

Conversation

@7schmiede

Copy link
Copy Markdown
Member

What and why

Since #544 a job is running from its launch until it ends (before, starting). A code review before 0.49.4 (documented internally) found places that still read running as "up" without the job exception that start_and_wait, ensure_after and a command's requires have:

  • Candidate pipeline (candidate_inner): a running job counts as a start in progress again, so a change to its files while it runs keeps its paths for resume_changes, as before A running job shows no usage and stays "starting" for its whole run #544. (A change to a job's own files was never built after the job, before A running job shows no usage and stays "starting" for its whole run #544 either; that would be new behaviour, not done here.)
  • A lane started on a pool node (readiness): waits for a running job until it completed, so a job that fails after it ran is reported and the start does not count as done before a migration ended. ready_count agrees: a running job is not ready, a completed one is.
  • Warm restart of a lane on a node (restart_services): leaves a running job alone, as the local restart_running does; before, it stopped the job and ran it again.

The lists of what runs on a node (active_now, follow_state) keep a running job, as the local is_active does.

Verification

Bug class running-read-as-ready
Red supervisor::candidate::tests::a_change_while_a_job_runs_is_kept ("the change waits for the job's start"), remote::tests::a_running_job_on_a_node_is_not_ready_yet (Some(Ok(())) instead of None; the restart part red with its line reverted).
Green cargo test -p devstack-daemon 221 passed, clippy clean.
Siblings Fixed: ready_count, restart_services. Left: the hub's summary (notify/rules.rs, Scope::glance) counts a running job as ready; it needs the service's kind in the snapshot (issue follows).

🤖 Generated with Claude Code

7schmiede and others added 2 commits November 18, 2026 14:30
… is ready

Since #544 a job is `running` from its launch until it ends; before, it
was `starting`. Two places still read `running` as "up" without the
job exception that `start_and_wait`, `ensure_after` and a command's
`requires` have:

- The candidate pipeline (`candidate_inner`) counts a running job as a
  start in progress again: a change to its files while it runs keeps its
  paths for `resume_changes`, as it did while the job was `starting`.
- A lane started on a pool node (`readiness`) waits for a running job
  until it completed, so a job that fails after it ran is reported and
  the start does not count as done before a migration ended. The
  progress count (`ready_count`) agrees with it: a running job is not
  ready, a completed one is (it was never counted before).
- A warm restart of a lane on a node (`restart_services`) leaves a
  running job alone, as the local `restart_running` does (a job has no
  main instance); before, it stopped the job and ran it again.

The lists of what runs on a node (`active_now`, `follow_state`) keep a
running job: the local side counts it the same way (`is_active`).

Found in review of #544.

Bug-Class: running-read-as-ready
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede merged commit 1f93569 into main Nov 18, 2026
14 checks passed
@7schmiede
7schmiede deleted the fix/job-running branch November 18, 2026 14:07
7schmiede added a commit that referenced this pull request Nov 19, 2026
Since #544 a job is `running` while it runs. Two more places read that
as "up", without the job exception the daemon's own checks have (#573):

- The hub's summary (`Scope::glance`) counted a running job as ready, so a
  stack whose migration still ran showed as ready on the start page. It
  now counts as starting; the kind comes from the snapshot, as a service
  event carries none (#575).
- The build timeline marked a job's build live from its start, and kept
  it live when the job then failed. A job's build is live once the job
  completed with exit code 0; `GET /v1/services/{name}/builds` passes the
  service's kind (#571).

Closes #571
Closes #575

Bug-Class: running-read-as-ready
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7schmiede added a commit that referenced this pull request Nov 19, 2026
Since #544 a job is `running` while it runs. Two more places read that
as "up", without the job exception the daemon's own checks have (#573):

- The hub's summary (`Scope::glance`) counted a running job as ready, so a
  stack whose migration still ran showed as ready on the start page. It
  now counts as starting; the kind comes from the snapshot (#575).
- The build timeline marked a job's build live from its start, and kept
  it live when the job then failed. A job's build is now `running` while
  the job runs, `live` once it completed with exit code 0, and `failed`
  with its reason; the test replays the candidate events of a rebuild
  (code review before 0.51.0, finding 2) (#571).

The dashboard's own bucket for a running job is #591.

Closes #571
Closes #575

Bug-Class: running-read-as-ready
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7schmiede added a commit that referenced this pull request Nov 20, 2026
`statusBucket` read a `running` status as healthy whatever the service's
kind, so the overview's count, its filter and a job's shortcut card put
a migration that still runs there. It takes the service now (status and
kind, both required, so no caller can leave the kind out) and puts a
running job into `starting` until it completed, as the daemon (#573) and
the hub's summary (#575) count it. The mock hub's `requires` check, which
let a running job count as a ready dependency, uses it too.

Closes #591

Bug-Class: running-read-as-ready

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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