koush / scrypted

Scrypted is a high performance video integration and automation platform
https://scrypted.app
Other
4.32k stars 255 forks source link

server: aggressively catch child process pipe errors #1609

Closed bjia56 closed 1 month ago

bjia56 commented 1 month ago

In the case where a plugin requests a non-standard Python version that must be installed via portable-python, the extra pipes are used via PassThroughs and errors are not properly caught. This results in a high probability of a server crash when the plugin is killed and restarted.

koush commented 1 month ago

I suspect this may also affect node child processes. it's probably manifested but a systemd/docker restart brings the server back up immediately. it would explain why typescript debugging occasionally crashes the server too. can we get a general function in ChildProcessWorker that hooks all stdio for errors and emits?

koush commented 1 month ago

incidentally I think the node pipe call should deliver errors down the pipe.

bjia56 commented 1 month ago

I suspect this may also affect node child processes. it's probably manifested but a systemd/docker restart brings the server back up immediately. it would explain why typescript debugging occasionally crashes the server too. can we get a general function in ChildProcessWorker that hooks all stdio for errors and emits?

I moved this to setupWorker which seems to be the shared function called by subclasses