-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Take a look at this article: http://www.guido-flohr.net/never-delete-your-pid-file/
Removing a pid file when exiting can cause race conditions because unlinking a file doesn't cause other file handles to be closed immediately. Leaving a file around and getting an exclusive write lock is better.
It might be worth considering if there is a way for this library to reduce the likelihood of race conditions around the PID file, and handle PIDs with an exclusive lock instead of file presence. Additionally, the OS can re-use a PID, so even if a PID is in use, it may belong to a completely different process. However, if a lock is detected on the PID file, then it is more likely that the PID in the file belongs to process that last wrote the PID.
matthiasg and SuperAuguste
Metadata
Metadata
Assignees
Labels
No labels