gorakhargosh/watchdog — Issue #77: needs to be made thread safe
Author: toddw-as
Created: 2011-10-17 19:42:27+00:00
State: open

I notice there are a number of places in watchdog that arn't properly thread safe. For example:

EventDispatcher._dispatch_events()
event, watch = event_queue.get(block=True, timeout=timeout)
self.dispatch_event(event, watch)

This code path is not thread safe, as the watch object could get removed by the time the "dispatch_event" method obtains it's lock.

When running into this, it results in a KeyError and the resulting thread dying, thus watchdog no longer monitors a path. I had a traceback of this, but I've misplaced it at the moment, will past it it the next time I see it.