-
-
Notifications
You must be signed in to change notification settings - Fork 704
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid race condition crash when a directory is swapped for a file
This commit builds off the race condition checking introduced in 2e83199, but also correctly handles the case where a directory is replaced with a file before it can be walked. For example: 1. [external] create /a/b/c.txt 2. [watchdog] walk /a (contains directory /a/b/ at this point) 3. [external] rm -rf /a/b/ 4. [external] touch /a/b 5. [watchdog] walk /a/b/ (raises NotADirectoryError/ENOTDIR) Also adds a test case that runs through the above example to ensure that an exception is no longer raised.
- Loading branch information
Showing
2 changed files
with
21 additions
and
3 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