fix(ghidra): recover stale clients on same-target reopen (#2014)
* fix(ghidra): recover stale clients on same-target reopen * test(ghidra): allow supervised shutdown in health regression * fix(ghidra): read process exit without diagnostic snapshots Health and startup exit checks called the supervisor snapshot, which concatenates retained launcher output only to read the exit code. * test(adb): align fixtures with literal output and directory commands --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
This commit is contained in:
co-authored by
Cursor Agent
morluto
parent
69e097a8ca
commit
4573e8cf35
Vendored
+8
@@ -31,7 +31,10 @@ if (mode === "exit") process.exit(73);
|
||||
if (mode === "silent") setInterval(() => undefined, 1_000);
|
||||
else {
|
||||
await rm(endpointPath, { force: true });
|
||||
const sockets = new Set();
|
||||
const server = createServer((socket) => {
|
||||
sockets.add(socket);
|
||||
socket.once("close", () => sockets.delete(socket));
|
||||
socket.setEncoding("utf8");
|
||||
const state = {
|
||||
buffer: { value: "" },
|
||||
@@ -45,6 +48,11 @@ else {
|
||||
};
|
||||
socket.on("data", (chunk) => onSocketData(socket, server, chunk, state));
|
||||
});
|
||||
process.on("message", (message) => {
|
||||
if (message !== "disconnect") return;
|
||||
for (const socket of sockets) socket.destroy();
|
||||
process.send?.({ event: "disconnected" });
|
||||
});
|
||||
if (transport === "unix-socket") server.listen(endpointPath);
|
||||
else {
|
||||
server.listen(0, "127.0.0.1", async () => {
|
||||
|
||||
Reference in New Issue
Block a user