You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: shutdown after client disconnect can crash on stdout EPIPE from resource-list notifications, orphaning ffmpeg #229
The disconnect path is exactly when the server must clean up recordings. A crash in the middle of stopAll leaves sessions marked "recording", loses the event-log summary and, if graceful q times out, skips the killPid fallback. ffmpeg then keeps capturing until its cap (default 3600 s).
Evidence
src/resources.ts:84-86: getStore().onChange(() => { if (server.isConnected()) server.sendResourceListChanged(); }). isConnected() is still true after stdin EOF.
Nothing listens for error on process.stdout (grep stdout.on src/*.ts finds only the WGC child's stdout).
Path: stdin end → shutdown → stopSession / event-log finalizer → store.update → onChange → write to a closed pipe → uncaught EPIPE. A minimal child-process repro dies with uncaught EPIPE.
Set a shuttingDown flag before cleanup and skip notifications once it is set. Add process.stdout.on("error", () => {}) (or route to stderr logging) so a dead pipe can never abort cleanup. Wrap the onChange callback in try/catch.
Done when
A test simulates stdin EOF with stdout closed during an active (mocked) recording; shutdown completes, the session is marked stopped and no uncaught exception is raised.
Activity