Skip to content

Conversation

@crwood
Copy link
Member

@crwood crwood commented Jun 21, 2022

This PR removes tahoe's "twistd.pid" in favor of using Gridsync's Supervisor for pidfile creation/management.

On non-Windows systems, Twisted/twistd will create its own pidfile ("twistd.pid") for tahoe processes and will refuse to (re)start tahoe if the pid number in the file matches any running process, irrespective of the name of that process. Gridsync's Supervisor, however, also creates/manages pidfiles for its processes (including on Windows!) but, unlike twistd, will include and check/verify the name of the process attached to the pid in the pidfile and determine staleness accordingly (i.e., by killing/restarting the process if the name actually corresponds to that of the process it is supposed to be managing, or by removing the pidfile if it does not). Removing "twistd.pid" (in favor of using Supervisor pidfiles) thus 1) avoids the situation in which tahoe will refuse to (re)start because a) it terminated uncleanly previously and b) some other process has since begun using the same pid contained in that pidfile and 2) allows Windows subprocesses to be managed in a way that is more consistent with the other operating systems supported by Gridsync.

@crwood crwood merged commit ac7dd1a into master Jun 21, 2022
@crwood crwood deleted the remove-stale-pidfile branch June 21, 2022 01:29
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.

2 participants