@rivetkit/engine-runner 0.0.0-pr.4879.d508104 → 0.0.0-pr.4880.c7bfbc5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivetkit/engine-runner",
3
- "version": "0.0.0-pr.4879.d508104",
3
+ "version": "0.0.0-pr.4880.c7bfbc5",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -25,8 +25,8 @@
25
25
  "bench": "tsx benches/actor-lifecycle.bench.ts"
26
26
  },
27
27
  "dependencies": {
28
- "@rivetkit/virtual-websocket": "0.0.0-pr.4879.d508104",
29
- "@rivetkit/engine-runner-protocol": "0.0.0-pr.4879.d508104",
28
+ "@rivetkit/virtual-websocket": "0.0.0-pr.4880.c7bfbc5",
29
+ "@rivetkit/engine-runner-protocol": "0.0.0-pr.4880.c7bfbc5",
30
30
  "uuid": "^12.0.0",
31
31
  "pino": "^9.9.5",
32
32
  "ws": "^8.18.3"
package/src/mod.ts CHANGED
@@ -560,18 +560,9 @@ export class Runner {
560
560
  this.#kvRequests.clear();
561
561
 
562
562
  // Close WebSocket
563
- //
564
- // A CONNECTING socket cannot send graceful stopping messages, so
565
- // it is always closed directly. Without this, a shutdown that
566
- // races with a reconnect leaves the in-flight WebSocket alive
567
- // while the rest of the runner state (tunnel, intervals) has been
568
- // torn down.
569
- const pegboardWebSocket = this.#pegboardWebSocket;
570
- const readyState = pegboardWebSocket?.readyState;
571
- const isOpen = readyState === 1;
572
- const isConnecting = readyState === 0;
573
- if (pegboardWebSocket && (isOpen || isConnecting)) {
574
- if (immediate || isConnecting) {
563
+ const pegboardWebSocket = this.getPegboardWebSocketIfReady();
564
+ if (pegboardWebSocket) {
565
+ if (immediate) {
575
566
  // Stop immediately
576
567
  pegboardWebSocket.close(1000, "pegboard.runner_shutdown");
577
568
  } else {
@@ -883,10 +874,6 @@ export class Runner {
883
874
  if (this.runnerId !== init.runnerId) {
884
875
  this.runnerId = init.runnerId;
885
876
 
886
- // Invalidate cached child logger so subsequent log
887
- // lines pick up the new runnerId.
888
- this.#logCached = undefined;
889
-
890
877
  // Clear actors if runner id changed
891
878
  this.#stopAllActors();
892
879
  }