fix(node-agent): handle bridge spawn ENOENT + add pid:host for process detection
Two bugs causing deltacast recorder 500s:
1. startDeltacastBridge() had no proc.on('error') handler — ENOENT when
deltacast-bridge binary not in container PATH crashed the entire node-agent
process (unhandled error event). Added error handler that logs and clears
_dcBridge so the sidecar start continues.
2. node-agent container lacked pid:host — _dcBridgeProcessAlive() scans /proc
but without host PID namespace it only sees container PIDs, so it always
returned false and tried to re-spawn the bridge (hitting bug 1).
pid:host lets the /proc scan see the host's deltacast-bridge systemd process.
🤖 Generated with Claude Code
This commit is contained in:
parent
6895fbc5af
commit
e97a289722
2 changed files with 6 additions and 0 deletions
|
|
@ -43,6 +43,7 @@ services:
|
||||||
build: ./services/node-agent
|
build: ./services/node-agent
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
network_mode: host
|
network_mode: host
|
||||||
|
pid: host
|
||||||
environment:
|
environment:
|
||||||
MAM_API_URL: ${MAM_API_URL}
|
MAM_API_URL: ${MAM_API_URL}
|
||||||
NODE_TOKEN: ${NODE_TOKEN:-}
|
NODE_TOKEN: ${NODE_TOKEN:-}
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,11 @@ function startDeltacastBridge() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
proc.on('error', (err) => {
|
||||||
|
console.error(`[dc-bridge] spawn error: ${err.message} (binary=${DC_BRIDGE_BIN})`);
|
||||||
|
_dcBridge = null;
|
||||||
|
});
|
||||||
|
|
||||||
proc.on('exit', (code, sig) => {
|
proc.on('exit', (code, sig) => {
|
||||||
console.error(`[dc-bridge] exited code=${code} signal=${sig}`);
|
console.error(`[dc-bridge] exited code=${code} signal=${sig}`);
|
||||||
_dcBridge = null;
|
_dcBridge = null;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue