Make daemon shutdowns easier to diagnose (#1790)
* fix(daemon): log stop reasons and client identity Record websocket client identity, process memory/uptime, and shutdown reasons across CLI, desktop, supervisor, and worker paths so daemon drops can be traced from the triggering client to worker termination. * fix(daemon): keep shutdown diagnostics in sync Test drift: supervisor and relay tests still asserted the old log text and metadata shape after shutdown diagnostics started logging structured reasons and relay connection ids. Update those assertions to the new diagnostic contract. Also centralize client lifecycle reason normalization and derive desktop daemon stop reasons from one tuple so future changes cannot silently drift.
This commit is contained in:
@@ -229,8 +229,14 @@ try {
|
||||
);
|
||||
const capturedSupervisorLogs = await readCapturedSupervisorLogs(paseoHome, recentSupervisorLogs);
|
||||
assert(
|
||||
capturedSupervisorLogs.includes("Restart requested by worker. Stopping worker for restart..."),
|
||||
`restart should route through supervisor restart intent, logs:\n${capturedSupervisorLogs}`,
|
||||
capturedSupervisorLogs.includes('"msg":"Worker requested restart"') &&
|
||||
capturedSupervisorLogs.includes('"reason":"settings_update"'),
|
||||
`restart should log lifecycle restart reason from daemon worker, logs:\n${capturedSupervisorLogs}`,
|
||||
);
|
||||
assert(
|
||||
capturedSupervisorLogs.includes('"msg":"Supervisor sending signal to worker"') &&
|
||||
capturedSupervisorLogs.includes('"signal":"SIGTERM"'),
|
||||
`restart should log supervisor signal dispatch, logs:\n${capturedSupervisorLogs}`,
|
||||
);
|
||||
console.log("✓ app-style restart keeps daemon healthy and restarts worker\n");
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user