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
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: