Skip to content

fix(daemon): a running job shows what it uses, and that it runs (#544) - #547

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

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

Conversation

@7schmiede

@7schmiede 7schmiede commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

What and why

A kind = "job" showed starting with no usage for its whole run (#544): its instance never became main (start_locked waited with it as a local), so tree_usage had nothing to measure.

  • Usage: the slot keeps what the instance being started uses (starting_usage), sampled by wait_instance every NATIVE_EVERY while a job runs or a service waits for its health check; tree_usage takes main, else that; cleared when the start is over. A candidate's wait notes nothing (its service's main is measured).
  • State: a job is running from its launch until it ends. Its start's duration (diagnostic log) still runs to its end. Its dependants (after, unchanged), a command's requires and devstack up (both adjusted) still wait for completed; the integration test that stops a running job waits for running now.

Review card

Approved by the owner on 2026-11-16 (in the conversation): points 1 and 2.

Category Point Beats Reversing costs
contract A job's state is running from its launch until it ends (was starting), in the API, the events, status (CLI, MCP) and the dashboard a new state (working) every client would have to learn clients that read a job's state; the dashboard's mock already shows running
contract devstack up and a command's requires count a job as done only at completed, never at running treating running as ready, as for other services low

Checks

  • a_running_job_shows_running_and_what_it_uses: red before (never running), green after.
  • End to end on Windows, isolated, a job of ~8 s: 0.47.0 shows starting and burn - - - in top; this build running and burn 0.8% 13.5 MiB 2; up returns after the job (8.7 s) in both.
  • cargo fmt --check, cargo clippy --workspace --all-targets --locked -D warnings, cargo test -p devstack-daemon (213), cargo test -p devstack, npm test in ui/ (253).

Closes #544

🤖 Generated with Claude Code

7schmiede and others added 2 commits November 16, 2026 16:24
A job's instance never became `main`: `start_locked` waited in
`wait_instance` with it as a local and ended it there, so `tree_usage` had
nothing to measure for its whole run, and its state stayed `starting`.

- The slot keeps what the instance being started uses
  (`starting_usage`), sampled by `wait_instance` every `NATIVE_EVERY` while
  a job runs or a service waits for its health check; `tree_usage` takes
  `main`, else that, and the start clears it when it is over.
- A job is `running` from its launch until it ends. Its start's duration
  still runs to its end (`set_status_of` keeps `spawned` for a job's
  `running`). Its dependants (`after`), a command's `requires` and
  `devstack up` still wait for `completed`.

Closes #544

Bug-Class: unmeasured-start
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…544)

The unit test runs on Windows only (elsewhere a process needs devstack's shim binary); the daemon's integration test checks the job's usage on every platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede merged commit 3964df2 into main Nov 16, 2026
14 checks passed
@7schmiede
7schmiede deleted the fix/job-usage-running branch November 16, 2026 16:33
@7schmiede 7schmiede mentioned this pull request Nov 16, 2026
7schmiede added a commit that referenced this pull request Nov 16, 2026
The dashboard opens on a start page with every stack as a tile, a service
marked `shortcut = true` gets a card of its own with a large button that
opens it, and a running job shows that it runs and what it uses. Fixed: a
lane no longer lands on ports another stack claims for its lane on a node,
whether it starts here or on a node; the stacks' registry keeps an entry it
meets while another daemon replaces it; a machine the pool provisioned is
not given back the moment it enrols, nor right after a lease on it began;
the start page's tiles follow starts and stops from other tabs.

Also ADR-0106 (a running job is `running` and measured), the record of #547.

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.

A running job shows no usage and stays "starting" for its whole run

1 participant