@zixt/host 0.0.128 → 0.0.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ import { homedir as homedir4 } from "node:os";
|
|
|
28
28
|
// package.json
|
|
29
29
|
var package_default = {
|
|
30
30
|
name: "@zixt/host",
|
|
31
|
-
version: "0.0.
|
|
31
|
+
version: "0.0.129",
|
|
32
32
|
type: "module",
|
|
33
33
|
exports: {
|
|
34
34
|
".": "./src/client.ts",
|
|
@@ -25600,6 +25600,9 @@ function watchForUpdates(options) {
|
|
|
25600
25600
|
};
|
|
25601
25601
|
}
|
|
25602
25602
|
|
|
25603
|
+
// src/exit-codes.ts
|
|
25604
|
+
var DO_NOT_RESTART_EXIT_CODE = 64;
|
|
25605
|
+
|
|
25603
25606
|
// src/runners/process-tree.ts
|
|
25604
25607
|
import { spawn as spawn3 } from "node:child_process";
|
|
25605
25608
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
@@ -26629,8 +26632,9 @@ var CONTAINMENT_SUMMARY = {
|
|
|
26629
26632
|
probation_commit: "could not commit its probation evidence"
|
|
26630
26633
|
};
|
|
26631
26634
|
function describeWorkerExit(record2) {
|
|
26635
|
+
const controlledStop = record2.containment === null && record2.signal === null && record2.code === DO_NOT_RESTART_EXIT_CODE;
|
|
26632
26636
|
return {
|
|
26633
|
-
summary: record2.containment ? CONTAINMENT_SUMMARY[record2.containment] : record2.signal ? `was killed by ${record2.signal}` : `exited unexpectedly with code ${record2.code ?? "unknown"}`,
|
|
26637
|
+
summary: controlledStop ? "stopped because this Machine needed attention" : record2.containment ? CONTAINMENT_SUMMARY[record2.containment] : record2.signal ? `was killed by ${record2.signal}` : `exited unexpectedly with code ${record2.code ?? "unknown"}`,
|
|
26634
26638
|
context: {
|
|
26635
26639
|
...record2.version ? { version: record2.version } : {},
|
|
26636
26640
|
...record2.pid === null ? {} : { pid: record2.pid },
|
|
@@ -26640,7 +26644,8 @@ function describeWorkerExit(record2) {
|
|
|
26640
26644
|
heartbeats: record2.heartbeats,
|
|
26641
26645
|
readiness: record2.readinessMilestones,
|
|
26642
26646
|
...record2.msSinceHeartbeat === null ? {} : { sinceHeartbeat: `${record2.msSinceHeartbeat}ms` }
|
|
26643
|
-
}
|
|
26647
|
+
},
|
|
26648
|
+
replayNext: controlledStop ? "This was a controlled stop, not a crash. Review the earlier Host message if this Machine still needs attention" : "This Machine restarted itself; report it if the same exit repeats"
|
|
26644
26649
|
};
|
|
26645
26650
|
}
|
|
26646
26651
|
|
|
@@ -27852,7 +27857,6 @@ var SUPERVISOR_PROTOCOL_ENV = "ZIXT_HOST_SUPERVISOR_PROTOCOL";
|
|
|
27852
27857
|
var SUPERVISOR_VERSION_ENV = "ZIXT_HOST_SUPERVISOR_VERSION";
|
|
27853
27858
|
var SUPERVISOR_PROTOCOL = "2";
|
|
27854
27859
|
var SUPERVISOR_RELOAD_EXIT_CODE = 76;
|
|
27855
|
-
var DO_NOT_RESTART_EXIT_CODE = 64;
|
|
27856
27860
|
var RESTART_BACKOFF_MS = 2e3;
|
|
27857
27861
|
var MAX_RESTART_BACKOFF_MS = 6e4;
|
|
27858
27862
|
var CRASH_STREAK_RESET_MS = 6e4;
|
|
@@ -44590,12 +44594,12 @@ clientForConsole.current = client;
|
|
|
44590
44594
|
var diagnosticsRoot = configuredWorkerDiagnosticsRoot();
|
|
44591
44595
|
var reportedWorkerExits = diagnosticsRoot ? await readWorkerExits(diagnosticsRoot) : [];
|
|
44592
44596
|
for (const { record: record2 } of reportedWorkerExits) {
|
|
44593
|
-
const { summary, context } = describeWorkerExit(record2);
|
|
44597
|
+
const { summary, context, replayNext } = describeWorkerExit(record2);
|
|
44594
44598
|
replayConsoleLine("error", `The previous Zixt Host worker ${summary}`, {
|
|
44595
44599
|
machine,
|
|
44596
44600
|
at: record2.at,
|
|
44597
44601
|
...context,
|
|
44598
|
-
next:
|
|
44602
|
+
next: replayNext
|
|
44599
44603
|
});
|
|
44600
44604
|
for (const line of record2.stderr) replayConsoleLine("error", "Previous worker output", { line });
|
|
44601
44605
|
}
|
|
@@ -44632,7 +44636,7 @@ function shutdown(exitCode = 0) {
|
|
|
44632
44636
|
// the honoured code can differ from the verdict this stop was for.
|
|
44633
44637
|
...code === exitCode ? {} : { requested: exitCode },
|
|
44634
44638
|
activeTasks: activeSessions,
|
|
44635
|
-
next: "The Host restarts automatically; report this if it repeats"
|
|
44639
|
+
next: code === DO_NOT_RESTART_EXIT_CODE ? "Resolve the earlier Host message, then start the Host again" : "The Host restarts automatically; report this if it repeats"
|
|
44636
44640
|
}
|
|
44637
44641
|
);
|
|
44638
44642
|
}
|