Skip to content

Conversation

@crwood
Copy link
Member

@crwood crwood commented May 16, 2022

This PR adds a new Supervisor class/module for handling -- and monitoring -- the execution of longer-lived background processes. Any processes started by the Supervisor (specifically, Gridsync's tahoe and magic-folder subprocesses) will be kept alive indefinitely and/or restarted in the event that they are killed by external factors (such as in the event of crash, OOM issues, etc.) -- or, at least, until the Supervisor is stopped. The Supervisor will also optionally prevent multiple instances of the same supervised process from launching (using pidfiles).

In addition to the primary process-supervisor functionality, this PR also refactors/updates some routines adjacent to the Tahoe and MagicFolder start/stop methods to facilitate restoring lost functionality after a process has been restarted (for example, by reloading configuration changes, reconnecting websockets to the appropriate logging and status endpoints, etc.) and slightly improves error handling when such processes fail to launch at application start up (specifically, by capturing the output of the failed command and displaying it to the user -- instead of simply showing the process' exit code as was done previously).

Closes #455

@crwood crwood merged commit 8d6c8cd into master May 16, 2022
@crwood crwood deleted the 455.process-supervisor branch May 16, 2022 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gridsync does nothing in response to missing/killed subprocesses

2 participants