@camstack/server 1.2.402 → 1.2.404

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/launcher.js CHANGED
@@ -766,10 +766,17 @@ async function launch() {
766
766
  console.log('[launcher] Starting server...');
767
767
  await Promise.resolve().then(() => __importStar(require('./main')));
768
768
  }
769
+ // The role runtime has installed its own SIGTERM/SIGINT handlers now. Stop
770
+ // intercepting those signals here: calling process.exit() first prevented the
771
+ // hub/agent's asynchronous broker shutdown from running at all. Keep SIGHUP
772
+ // launcher-owned as before.
773
+ process.off('SIGTERM', handleSignal);
774
+ process.off('SIGINT', handleSignal);
769
775
  }
770
- // Signal handlers — forward to default exit so NestJS shutdown hooks
771
- // (Moleculer broker stopped() → kills spawned workers) run cleanly.
772
- // Without these, TTY close / `npm run serve` kill leaves workers orphaned.
776
+ // Bootstrap-window signal handlers. Once the selected role has installed its
777
+ // own graceful handlers, launch() removes these for SIGTERM/SIGINT. Before that
778
+ // point an immediate exit is intentional; the process-group exit backstop kills
779
+ // any runner group that managed to start during the interrupted boot.
773
780
  let shuttingDown = false;
774
781
  const handleSignal = (signal) => {
775
782
  if (shuttingDown)
package/dist/main.js CHANGED
@@ -127,6 +127,10 @@ function immediateChildCleanup(signal) {
127
127
  return;
128
128
  shutdownStarted = true;
129
129
  console.log(`[shutdown] Received ${signal} — killing child processes immediately…`);
130
+ // Every addon-runner leads its OWN process group (D668), so the hub-group kill
131
+ // below no longer reaches runners or their ffmpeg/llama-server children.
132
+ // Signal each runner group first.
133
+ const runnerGroups = (0, system_1.signalAllRunnerGroups)('SIGTERM');
130
134
  // Synchronously kill all children of this process via the OS.
131
135
  // This is fast and ensures no orphans even if Fastify shutdown is slow.
132
136
  try {
@@ -137,7 +141,7 @@ function immediateChildCleanup(signal) {
137
141
  ? `pkill -TERM -P ${myPid} 2>/dev/null; true`
138
142
  : `kill -- -${myPid} 2>/dev/null; true`;
139
143
  (0, node_child_process_1.execSync)(cmd, { timeout: 3000 });
140
- console.log('[shutdown] Child processes signalled');
144
+ console.log(`[shutdown] Child processes signalled (runner groups: ${runnerGroups})`);
141
145
  }
142
146
  catch {
143
147
  // Best effort — children may have already exited
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.402",
3
+ "version": "1.2.404",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "files": [
@@ -37,18 +37,18 @@
37
37
  ]
38
38
  },
39
39
  "dependencies": {
40
- "@camstack/addon-admin-ui": "1.2.280",
41
- "@camstack/addon-agent-ui": "1.2.152",
40
+ "@camstack/addon-admin-ui": "1.2.281",
41
+ "@camstack/addon-agent-ui": "1.2.153",
42
42
  "@camstack/addon-auth": "1.2.123",
43
43
  "@camstack/addon-decoder-nodeav": "1.2.115",
44
44
  "@camstack/addon-notifiers": "1.2.121",
45
- "@camstack/addon-pipeline": "1.2.302",
45
+ "@camstack/addon-pipeline": "1.2.304",
46
46
  "@camstack/addon-pipeline-orchestrator": "1.2.261",
47
47
  "@camstack/addon-post-analysis": "1.2.292",
48
48
  "@camstack/sdk": "1.2.118",
49
- "@camstack/system": "1.2.311",
49
+ "@camstack/system": "1.2.313",
50
50
  "@camstack/types": "1.2.267",
51
- "@camstack/ui-library": "1.2.210",
51
+ "@camstack/ui-library": "1.2.211",
52
52
  "@fastify/compress": "^9.0.0",
53
53
  "@fastify/cookie": "^11.0.2",
54
54
  "@fastify/cors": "^11.2.0",