← Back to Pull requests

Flag a Server whose disk is nearly full in status and server ls #3204

Closed
unknown closed this pull request without merging on Oct 23, 2026 07:43 UTC
View on GitHub
unknown unknown commented on Oct 23, 2026 05:56 UTC
Author

Fixes #3163

Summary

ployz status and ployz server ls now flag a Server that is nearly out of disk space, before a deploy fails on it. Before, nothing flagged a full disk until a pull failed.

 $ ployz server ls
+! Server machine-1's disk is nearly full: 300 MB free for Docker. Pulling an image onto it can fail until you free space.
 SERVER     MEMBERSHIP  ...

 $ ployz status
 staged = 0 changes
+machine-1 = Its disk is nearly full: 300 MB free for Docker. Pulling an image onto it can fail until you free space.

  • The CLI reads each reachable Server's Docker root through the Inspect RPC with InspectTelemetry::Full. That is the same request ployz server show already makes. The read is Client::observe_docker_disks in crates/ployz/src/cluster.rs, which skips a Machine that errors or takes longer than 3 s.

  • Under 1 GB free counts as nearly full. That matches ployzd's DISK_FULL_FREE_BYTES, the line at which it blames a failed pull on a full disk.

  • status adds a disk_full row under needs attention, after the other Server rows. --json gives the Server in machine and the free space in free_bytes. It doesn't mark the check partial or change the exit code.

  • server ls prints the same message as a warning. Under --json it lands in the warnings.

  • Each command reads disks at the same time as its other reads, so a hung Server adds no extra wait.

  • Docs: docs/user/troubleshooting/deployments.md, "My server's disk is full", says what flags it and what it doesn't check.
  • Not in this PR

  • /var/lib/containerd on its own disk. Inspect's host telemetry measures only Docker's root. Measuring containerd's store needs a daemon change.

  • Servers the check can't read. A Server that is down, whose daemon can't reach Docker, or that doesn't answer in 3 s isn't checked, and nothing says so. With a Read only or Deploy token, status asks Cloud, so it checks no disk.

  • The Cloud dashboard. This changes only the CLI.
  • Stable promise

    There is no wire, Store or daemon change. The PR adds a CLI call to an RPC that's already shipped. Additive output only: a new attention reason disk_full with a new subject shape {machine, free_bytes}, and a new warning line.

    DESIGN.md bets

  • 4. Partial results are outcomes. A failed disk read is advisory and leaves the check whole. It doesn't turn a healthy status into a partial one.
  • Evidence

  • Rung 2, crate units. Each test was written first and failed to compile before the change.

  • - handlers::server::show::tests::a_server_whose_docker_disk_is_nearly_full_is_named. With 30 MB free on machine-1, exactly 1 GB on machine-2, and no reading for machine-3, only machine-1 is named.
    - handlers::status_servers::tests::status_names_a_server_whose_docker_disk_is_nearly_full pins the disk_full JSON row.
    - All 132 status, link and server::show tests in ployz pass, and cargo clippy -p ployz --all-features is clean.
  • Real Machines. Incus, 2 Machines, this checkout's CLI. machine-1's disk was filled with fallocate until 287 MB was free.

  •   $ ployz server ls
      ! Server machine-1's disk is nearly full: 300 MB free for Docker. Pulling an image onto it can fail until you free space.
      SERVER     MEMBERSHIP  STORAGE                    ...
      machine-1  up          Managed volumes available  ...
      machine-2  up          Managed volumes available  ...
    
      $ ployz status --json | jq .attention
      [{"free_bytes": 299995136, "machine": "machine-1", "message": "Its disk is nearly full: …", "reason": "disk_full"}]
      $ ployz status; echo $?
      machine-1 = Its disk is nearly full: 300 MB free for Docker. Pulling an image onto it can fail until you free space.
      0
    
      $ ployz deploy        # node:22-bookworm-slim, 2 replicas
      error: api on machine-1: The Server's disk is full: 0 MB free under /var/lib/containerd.
      

    After the filler was removed, neither command flagged anything. server ls took 0.28 s.

    Review

  • Round 1 (Codex + Opus).

  • - BUG (Codex): "Deploys onto it fail" was false, since a cached image still deploys. Now it reads "Pulling an image onto it can fail".
    - NIT (Opus): a hung Server cost about 6 s, because the disk read ran after the other reads. Now they run at the same time.
    - GAP (both): the unit tests skip the RPC path. The 1 GB boundary is now in the test. The RPC path is proven on Incus above.
    - GAP (both): the docs listed only one case the check skips. They now list all of them.
    - Dismissed: 999.5 MB prints as "1000 MB" (cosmetic). Folding the read into server ls's storage Inspect would put it behind the storage capability check.
    - Opus confirmed: Down and unarrived Servers are skipped, disks are still checked while a deploy rolls out, and nothing in dashboard/ reads these attention reasons.
  • Round 2 (Codex, fix diff). No BUG-class findings. It checked that machines() errors still map to Unreached as before, that both joins keep the read order, and that the docs match.
  • Merge Danger

    Door: two-way

    Blast Radius: CLI status and server ls output

    One extra read-only Inspect per reachable Server, and a new advisory row or warning only when a Server has under 1 GB free.

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: nick-potts Review duration: 106m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3204"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.5% · Safe to merge
    22.5%
    Repository