Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions engine/sdks/typescript/runner/src/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
}

#actors: Map<string, ActorInstance> = new Map();
#actorWebSockets: Map<string, Set<WebSocketTunnelAdapter>> = new Map();

Check warning on line 107 in engine/sdks/typescript/runner/src/mod.ts

View workflow job for this annotation

GitHub Actions / quality

lint/correctness/noUnusedPrivateClassMembers

This private class member is defined but never used.

// WebSocket
#pegboardWebSocket?: WebSocket;
Expand Down Expand Up @@ -386,7 +386,7 @@
const pegboardWebSocket = this.#pegboardWebSocket;
if (immediate) {
// Stop immediately
pegboardWebSocket.close(1000, "Stopping");
pegboardWebSocket.close(1000, "pegboard.runner_shutdown");
} else {
// Wait for actors to shut down before stopping
try {
Expand Down Expand Up @@ -431,7 +431,7 @@
this.log?.info({
msg: "closing WebSocket",
});
pegboardWebSocket.close(1000, "Stopping");
pegboardWebSocket.close(1000, "pegboard.runner_shutdown");

await closePromise;

Expand Down Expand Up @@ -681,22 +681,25 @@
closeError?.group === "ws" &&
closeError?.error === "eviction"
) {
this.log?.info({
msg: "runner evicted",
});
this.log?.info("runner websocket evicted");

this.#config.onDisconnected(ev.code, ev.reason);

await this.shutdown(true);
} else {
this.log?.warn({
msg: "runner disconnected",
namespace: this.#config.namespace,
runnerName: this.#config.runnerName,
code: ev.code,
reason: ev.reason.toString(),
closeError,
});
if (
closeError?.group === "pegboard" &&
closeError?.error === "runner_shutdown"
) {
this.log?.info("runner shutdown");
} else {
this.log?.warn({
msg: "runner disconnected",
code: ev.code,
reason: ev.reason.toString(),
closeError,
});
}

this.#config.onDisconnected(ev.code, ev.reason);
}
Expand Down
Loading