Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[hack] Track the lockfile across renames / deletes
Summary: We've been having some problems with multiple hh_servers running on the same directory, and I think this may be the problem. Since Unix file locks are associated with file descriptors, not actual files, we have the following failure mode: 1. tmpwatch deletes the lockfile 2. hh_server 1 thinks it still holds the lock, since the file descriptor to the deleted file still exists 3. hh_server 2 starts up, creates a new lockfile with the same name, and successfully locks the file Additionally, the previous code would periodically check if the lockfile could be locked, and only re-grab the lock if it finds that it can no longer lock it. I assume the intent of the code was to check if we actually owned the lockfile, not whether we _could_ own it, since that doesn't make sense at all. Reviewed By: @dlreeves Differential Revision: D2251973
- Loading branch information
Showing
3 changed files
with
33 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters