honker: row 194 b8 r2 (sage-2289): a fire stop stopRun can't confirm (unknown) reads as lifecycle.end.alive with reason unknown, never killed, and the Console flags it; cli T9a no-runtime-record test, bus T9a reason checks, M56; notes
This commit is contained in:
1 parent
0583569b74
commit
899e30a808
5 files changed
+59
-8
No files matched your search
@@ -830,7 +830,10 @@ export function createLauncher({
|
||||
record({ event: "fire-stop", instance: s.instance, run: s.run, request: r.request, outcome: out.outcome, pid: out.pid, signals: out.signals });
|
||||
return { run: s.run, pid: out.pid, outcome: out.outcome };
|
||||
}));
|
||||
return results.filter((x) => x.outcome === "killed" || x.outcome === "alive");
|
||||
// sage-2289: a stop that can't confirm the kill (unknown) reads as alive with reason unknown,
|
||||
// never as killed, so the Console flags it.
|
||||
return results.flatMap((x) => x.outcome === "unknown" ? [{ ...x, outcome: "alive", reason: "unknown" }]
|
||||
: x.outcome === "killed" || x.outcome === "alive" ? [x] : []);
|
||||
}
|
||||
|
||||
// V5 steps 1 to 3. The file goes first: once committed, check() refuses the name, so no launch
|
||||
|
||||
@@ -592,6 +592,28 @@ test("row 194 T9a: fire signals its bound run and a spawned but unbound registry
|
||||
assert.deepEqual(stops.find((e) => e.run === "coder-run").signals, ["SIGTERM", "SIGKILL"]);
|
||||
});
|
||||
|
||||
// sage-2289: a registry run with no row 191 runtime record makes stopRun answer unknown and send no
|
||||
// signal. Unknown can't confirm a kill, so it reads as alive with reason unknown, and the Console flags it.
|
||||
test("row 194 T9a: fire of a registry run with no runtime record reads lifecycle.end.alive with reason unknown, never killed", { skip, timeout: 60000 }, async (t) => {
|
||||
const p = prepare(t, listed);
|
||||
const s = await start(t, p, { stopOptions: { graceMs: 400, killWaitMs: 400 } });
|
||||
const bound = await standIn(t, p, s, { instance: "coder", run: "coder-run" });
|
||||
const ghost = await standIn(t, p, s, { instance: "coder", run: "coder-ghost", managed: false });
|
||||
bind(s, "coder", "coder-run");
|
||||
const fired = fire(s, bind(s, "chief", "chief-run"), "coder");
|
||||
assert.deepEqual(fired.runs, ["coder-run"]);
|
||||
await s.launcher.tick();
|
||||
assert.equal(await bound.exited, 143);
|
||||
await new Promise((r) => setTimeout(r, 300));
|
||||
assert.deepEqual([ghost.gone(), ghost.terms()], [false, 0]);
|
||||
const events = (action) => allowed(p, action).map((e) => [e.subject, e.body.request, e.body.run, e.body.pid, e.body.reason]);
|
||||
assert.deepEqual(events("lifecycle.end.killed"), []);
|
||||
assert.deepEqual(events("lifecycle.end.alive"), [["coder", fired.request, "coder-ghost", null, "unknown"]]);
|
||||
assert.deepEqual(s.call("instances").instances.coder.alive, ["coder-ghost"]);
|
||||
const stops = launchLog(p.f).filter((e) => e.event === "fire-stop" && e.request === fired.request);
|
||||
assert.deepEqual(stops.map((e) => [e.run, e.outcome]).sort(), [["coder-ghost", "unknown"], ["coder-run", "stopped"]]);
|
||||
});
|
||||
|
||||
// The fake clock makes the stop's steps exact: each identity look is counted at its instant, and
|
||||
// the second look at the first instant past the grace is stopRun's re-check just before the SIGKILL.
|
||||
test("row 194 T9a: a runner whose identity changed before the SIGTERM gets no signal, and one whose identity changed between the SIGTERM and the SIGKILL gets no SIGKILL", { skip, timeout: 60000 }, async (t) => {
|
||||
|
||||
Reference in new issue
Block a user