Skip to content

fix: data-folder lock, readable socket errors, Monitor warm-up, chip wrap, local version - #17

Merged
tieuanhquoc merged 1 commit into
masterfrom
fix/robustness-socket-lock-monitor-version
Oct 6, 2026
Merged

tieuanhquoc merged 1 commit into
masterfrom
fix/robustness-socket-lock-monitor-version

Conversation

@tieuanhquoc

Copy link
Copy Markdown
Collaborator

Summary

Five failure classes found while shooting the docs. Each is fixed at the shared layer every instance goes through, not at the one spot where it showed up.

Class Fix Covers
Unix socket path over the 103-byte sun_path limit fails silently New UnixSocketPath helper used by every bind/connect. A failed docker.sock now shows in the dashboard and host.log instead of only NSLog. StorageLocation.migrate refuses a too-deep destination before moving anything docker.sock, debug-shell.sock, socket environments, moving the data folder
One data folder, two owner processes flock on <root>/.dockz.lock (released by the kernel on exit/crash). A second copy explains who holds it and quits Docker VM and machines (all live in the data folder)
A start failure is retried as a crash VMRestartPolicy.classify: never reached .running → report, don't retry; stopped on its own while running → restart (unchanged) The Docker VM restart path
Monitor shows a misleading empty state while warming up Disk breakdown requested every tick until the first arrives (one request in flight), then every 10th. The table says "Reading stats for N running containers…" Monitor tab
List-header chips wrap mid-word Chips stay single-line at natural size; the search field shrinks 240 → 140 pt instead All 8 list pages (ListHeaderBar)
Local builds show a hardcoded 0.1.0 Version from the latest v* tag, build number from the commit count; CI still overrides build-and-bundle-app.sh

Testing

  • swift run DockzApp test: 260 checks pass, 16 of them new:
    • socket limit and its message, also through the connector;
    • lock: second owner refused with the holder's PID, released when dropped;
    • stop classification;
    • breakdown sampling.
  • Cross-process lock check against the real app binary, using throwaway data folders with no VM: 6/6.
    • Another process holds the lock → DockZ logs the holder's PID and leaves the lock file untouched.
    • Holder exits → the next copy takes the lock (confirmed with lsof).
    • Stale PID file with no lock → not treated as owned.
  • scripts/build-and-bundle-app.sh stamps 0.2.1 (28), matching git describe and rev-list --count.
  • Not checked visually: the chip/search-field layout. Please glance at Machines with a crowded header.

Note

The lock only protects once every running copy has it. An already-installed older DockZ doesn't take the lock.

🤖 Generated with Claude Code

…wrap, local version

Failure classes found while shooting the docs, each fixed where every
instance of it goes through:

- Unix socket paths over the 103-byte sun_path limit: one helper
  (UnixSocketPath) now checks every socket DockZ binds or connects to. A
  docker.sock that can't be created is shown in the dashboard instead of
  only logged, and moving the data folder refuses such a location up front.
- One data folder, two owners: an flock on <root>/.dockz.lock lets one
  DockZ process own a data folder (Docker VM and machines alike); a second
  copy explains who holds it and quits. A VM that never reached .running
  is reported, not restarted; one that crashes while running still is.
- Monitor warm-up: the disk breakdown is requested every tick until the
  first one arrives (one request at a time), and the table says it is
  reading stats rather than "No running containers".
- List headers: scope chips never wrap; the search field gives up width.
  Shared by all eight list pages.
- Local builds take CFBundleShortVersionString / CFBundleVersion from the
  latest v* tag and the commit count instead of a hardcoded 0.1.0.

Tests: 16 new checks (260 total, all passing) for the socket limit, the
lock, stop classification and breakdown sampling; the lock was also checked
across processes (holder named, released on exit, stale file ignored).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown
Contributor

Deploying dockz with  Cloudflare Pages  Cloudflare Pages

Latest commit: 610720c
Status: ✅  Deploy successful!
Preview URL: https://75b9678b.dockz.pages.dev
Branch Preview URL: https://fix-robustness-socket-lock-m.dockz.pages.dev

View logs

@tieuanhquoc
tieuanhquoc merged commit a0a33c8 into master Oct 6, 2026
3 checks passed
@tieuanhquoc
tieuanhquoc deleted the fix/robustness-socket-lock-monitor-version branch October 6, 2026 16:26
@tieuanhquoc tieuanhquoc mentioned this pull request Oct 7, 2026
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