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 edd4335
Browse filesBrowse the repository at this point in the historyBrowse files
feat(daemon): quiesce request that retires an idle daemon atomically
A daemon now answers an authenticated, instance-fenced daemon_quiesce request: it closes admission and
counts requests in flight, sessions, repair sessions and live leases in one synchronous step, refuses
with daemon-busy (reopening admission) if it holds any, and otherwise drains and exits. It publishes
capabilities in daemon.json so a client can tell a daemon that can quiesce from one that predates it.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: docs/adr/0006-daemon-rpc-protocol-version.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,3 +84,28 @@ the gap and its reason instead of implying coverage. See `test/wire-compat/READM
84
84
Legacy remote daemons without `rpcProtocolVersion` remain reachable. This keeps the first release of
85
85
the proxy compatible with older HTTP daemons, but it means absence of the marker is not proof of
86
86
compatibility.
87
+
88
+
## Daemon capabilities and quiesce
89
+
90
+
A daemon on the local state directory publishes `capabilities` in `daemon.json`. This is the
91
+
command-level metadata the decision above prefers to a protocol bump. A daemon that predates a
92
+
capability omits it, so a client treats absence as "cannot do this" and never infers it from the
93
+
package version.
94
+
95
+
`quiesce` is how a client replaces an incompatible daemon without destroying other clients' work.
96
+
The client sends `daemon_quiesce` with the daemon token and the pid and start time recorded in
97
+
`daemon.json`. The daemon checks the token and that it is that instance, refuses a request that
98
+
reached it as a remote-origin one, then closes admission and counts what it holds in a single
99
+
synchronous step: requests in flight, sessions, repair sessions and live leases. Any of them
100
+
refuses with `daemon-busy` and reopens admission in that same step. Otherwise it answers
101
+
`draining`, keeps admission closed, and shuts down. The request is answered before dispatch, so
102
+
it joins neither the in-flight count nor the command registry.
103
+
104
+
The daemon accepts a quiesce only when it can prove its own start time and the request names it with the pid; a daemon that cannot is never addressed. A
105
+
client never signals a daemon that did not accept one, except to retire it after it answered
106
+
`draining`.
107
+
108
+
The census counts what the contract names and nothing else. A resumable upload still streaming and
109
+
a host-administration human-control hold that names no lease are outside it, the same boundary
110
+
idle reap draws, so a quiesce can end them. A daemon started with an HTTP auth hook marks every
111
+
HTTP request remote-origin and so refuses a quiesce over HTTP; the socket transport is unaffected.
0 commit comments