You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 00b82dc
Browse filesBrowse the repository at this point in the historyBrowse files
fix(daemon): let a retained close answer every later stop of its instance
A close that keeps its registration left the state dir claimed with no
record of why, and the record it did write stopped answering after 60 s.
A stop that arrived later found a claimed dir, a closed listener, and no
evidence: it sat out its whole budget and failed with an unconfirmed
shutdown at a runtime that had already stopped serving.
- Every close that leaves the registration in place publishes its
retention record, whether or not a stop asked for it. The ledger answers
a request; this is a fact about the state dir, owed to whoever reads it
next. `finish()` states it for the case where the removal itself failed.
- A `retained` record answers by lifetime, not by age: the state it reports
holds until a new acquisition clears the file, so the age bound added
nothing beyond the pid and start-time fence. A `released` record keeps
its window, because its job is to answer the stop that asked.
- The wait proves the instance is still the process the record names
before trusting an aged record. A dead host's leftover file is not a
registration someone holds, and its honest answer is that nothing runs.
- Only a runtime a host owns publishes these records. A detached daemon's
stop signals its process and reads the shutdown report, so a completion
record there would state a fact nobody reads.
Co-Authored-By: Claude <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Unreleased
4
4
5
-
- A daemon a host process starts for itself now records that owner, and a stop honors it. `daemon status` names such a record `host-owned`, or `owner-not-recognized` for one whose owner this version cannot read. `daemon stop --state-dir <path>` reaches such a runtime over its registered local transport with an authenticated shutdown request and waits for it to report its own close, so nothing outside the host signals it; what that close could not finish is reported as warnings. A record whose owner this version cannot recognize gets the same request, because the running process answers for itself. Stop fails with `details.reason: 'daemon-embedded-stop-unreachable'` when a host-owned record's request cannot be delivered, and `'daemon-shutdown-unconfirmed'` when the runtime agreed and never reported its close. A `daemon.json` that exists but cannot be read fails the stop with `'daemon-record-unreadable'` instead of answering that nothing runs: the record may describe a daemon that is serving, so nothing is signaled and nothing is deleted. `--clean` is refused with `'daemon-clean-not-detached'` for any record that does not prove the process is a daemon of its own, because that cleanup walks the owner's whole process tree; stopping without `--clean` still works. A `--clean` of a detached daemon now follows the lifetime that same read proved.
5
+
- A daemon a host process starts for itself now records that owner, and a stop honors it. `daemon status` names such a record `host-owned`, or `owner-not-recognized` for one whose owner this version cannot read. `daemon stop --state-dir <path>` reaches such a runtime over its registered local transport with an authenticated shutdown request and waits for it to report its own close, so nothing outside the host signals it; what that close could not finish is reported as warnings. A record whose owner this version cannot recognize gets the same request, because the running process answers for itself. Stop fails with `details.reason: 'daemon-embedded-stop-unreachable'` when a host-owned record's request cannot be delivered, and `'daemon-shutdown-unconfirmed'` when the runtime agreed and never reported its close. A runtime that closed while it still held work reports what it kept, and a later stop reads that answer whenever the same host still holds the registration, however long ago the close happened. A `daemon.json` that exists but cannot be read fails the stop with `'daemon-record-unreadable'` instead of answering that nothing runs: the record may describe a daemon that is serving, so nothing is signaled and nothing is deleted. `--clean` is refused with `'daemon-clean-not-detached'` for any record that does not prove the process is a daemon of its own, because that cleanup walks the owner's whole process tree; stopping without `--clean` still works. A `--clean` of a detached daemon now follows the lifetime that same read proved.
6
6
- The PNG worker no longer calls `process.emitWarning` when it is unavailable, and it starts with an empty environment (`env: {}`). The daemon registers a sink when it pre-warms the worker, so every transition to unavailable (spawn failure, missing entry, load error, exit) leaves exactly one `png_worker_unavailable` event, with a typed `reason` (`entry-not-found`, `spawn-failed`, `worker-error`, `worker-exited`) and its `detail`, in `daemon.log`, with or without `--debug`. Requests then continue on the in-process fallback without repeating the event.
7
7
- Behavior change: `resolveHubAppReference`, shipped through `agent-device/plugins/webdriver`, now needs `cwd` to resolve a relative app path. Without it the call fails with `INVALID_ARGS` and `details.reason: provider_app_cwd_missing`; it used to resolve against the process's working directory. Absolute paths, URLs and provider references are unaffected. The daemon fills it from the client's working directory (or its host's) for every provider lease request, so `connect` and `lease_allocate` are unchanged.
8
8
- The `daemon-not-running` hint now always names `--state-dir <dir>`, and a daemon force-retired for outlasting its drain is reported as `Replaced unreachable daemon` instead of `Replaced idle daemon`. `daemon-drain-timeout` and the post-drain force retire are documented in the client API and `help`.
0 commit comments