Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid race condition crash when a directory is swapped for a file #513

Merged
merged 1 commit into from
Feb 16, 2019
Merged

Avoid race condition crash when a directory is swapped for a file #513

merged 1 commit into from
Feb 16, 2019

Commits on Jan 23, 2019

  1. 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.
    pR0Ps committed Jan 23, 2019
    Configuration menu
    Copy the full SHA
    dbd6748 View commit details
    Browse the repository at this point in the history