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 f5b44df
Browse filesBrowse the repository at this point in the historyBrowse files
fix(daemon): judge takeover ownership once inside the retirement
readReusableLocalDaemon rejected an embedded or unknown owner before the
central retirement could look at it, so a record whose owner had already
exited wedged every managed command instead of recovering. Delete the two
client guards and the resolveTimeoutRecovery ownership guard: ownership is
judged inside stopAndRetireDaemon on every takeover route
(readReusableLocalDaemon, replaceUnreachable, quiesceOrRetireUnresponsive,
awaitDrainedDaemon and forceRetireDaemon alike). Map a retained owner
reason to the existing typed errors once, in daemonRetirementError for the
stop route and daemonTakeoverRetirementError for a takeover, and prove the
managed route recovers a crashed embedded or unrecognized owner without
signaling it.
#3806 (comment)
@@ -43,8 +48,9 @@ export type DaemonStopResult = {
43
48
* Retires the daemon whose lifetime the caller read, and shapes that retirement as a stop result.
44
49
*
45
50
* The caller hands over the lifetime and the owner its own read proved, so routing and retirement judge
46
-
* one record. Only a detached daemon reaches here: a host owns an embedded runtime and ends it with its
47
-
* own close, and a record this build cannot place proves nothing about what is safe to signal.
51
+
* one record. Ownership is judged here and nowhere else: an embedded runtime belongs to its host, and a
52
+
* record this build cannot place proves nothing about what is safe to signal, so both come back as the
53
+
* refusal that names their owner, with nothing signaled.
48
54
*/
49
55
exportasyncfunctionstopDaemon(params: {
50
56
paths: DaemonPaths;
@@ -95,6 +101,25 @@ export async function stopDaemon(params: {
95
101
};
96
102
}
97
103
104
+
/**
105
+
* What a retirement that refused because of the record's owner answers with. This is the one place
106
+
* those two retained reasons become a stop's own reason: a caller that may not signal this process
107
+
* hears the owner's rule, not a retirement that could not be confirmed.
108
+
*/
109
+
functionownerRefusal(
110
+
reason: 'embedded-owner'|'owner-unproven',
111
+
): Readonly<{reason: string;hint: string}>{
112
+
returnreason==='embedded-owner'
113
+
? {
114
+
reason: DAEMON_LIFECYCLE_REASONS.ownerEmbedded,
115
+
hint: 'Nothing was signaled. Close the host that started this runtime, or repair its record after the process has exited.',
116
+
}
117
+
: {
118
+
reason: DAEMON_RECORD_OWNER_UNRECOGNIZED_REASON,
119
+
hint: 'Nothing was signaled. Check what owns that process, then repair the record: stop it by its own means and remove its daemon.json so a daemon can register again.',
0 commit comments