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

[DO NOT MERGE] Introduce 10uS delay in Inotify.read_events() to trigger a race #894

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/watchdog/observers/inotify_c.py
Expand Up @@ -24,6 +24,7 @@
from functools import reduce
from ctypes import c_int, c_char_p, c_uint32
from watchdog.utils import UnsupportedLibc
import time

libc = ctypes.CDLL(None)

Expand Down Expand Up @@ -259,6 +260,8 @@ def read_events(self, event_buffer_size=DEFAULT_EVENT_BUFFER_SIZE):
# created subdirectories/files. This will handle
# mkdir -p foobar/blah/bar; touch foobar/afile

time.sleep(0.000_01)

def _recursive_simulate(src_path):
events = []
for root, dirnames, filenames in os.walk(src_path):
Expand Down