-
-
Notifications
You must be signed in to change notification settings - Fork 708
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
KeyError in read_events while executing shell command #233
Comments
I did just this for a temporary fix: It works for me |
It would be nice to have a reproduceable example to find out why you are getting events for unknown watch descriptors instead of sweeping it under the rug. I have seen these errors before in logs, but not been able to find out what triggers it. |
This is exactly #117. I've found this issue when running my dose project on my PyScanPrev project root directory with After spending some time looking for the "root path of all evil", I think I found a reproduceable example to trigger that issue: a really fast create-remove loop for the same directory name a few times (about 30, perhaps less) seems enough for a stochastical approach. I've already add that as a test, and I've found a solution for this issue about crashing. But I think that opened up a Pandora's box. As it seems, that's an issue about a DELETE-CREATE-IGNORE sequence in the inotify buffer for the very same directory. To really force that in a non-stochastic way I'd need to mock events in this particular order, as the The loop really created 30
Testing again, it's clear that the numbers are random:
Actually, that's what I've got after implementing the straightforward solution for fixing this issue. I'm using |
- This is related to gorakhargosh#117 and gorakhargosh#233 - It's about a single path that is has 2 wd values, i.e., a subdirectory path that was created again before the "bookkeeping removal" event (IN_IGNORE) of a deletion was processed - The test is using a stochastical approach to reach the bug, in the sense that being "fast" isn't enough to enforce a particular event order; however, a "lucky" event synchronization seems extremely rare and the package should pass on every case - Even with an unknown order for the events, the test is counting and enforces: - Watchdog emits the 120 events that happened - Specific number of events for each type - Order constraing as required for minimal consistency (e.g. not deleting a directory that wasn't created)
- The call on inotify_event.is_ignored was removing the wrong wd, due to another wd with the same path (self._wd_for_path[src_path] was replaced) - Fix gorakhargosh#117 and gorakhargosh#233 - Still not enough to fix every bug regarding fast/unordered events, but doesn't crash anymore
Fixed by #375. |
- This is related to gorakhargosh#117 and gorakhargosh#233 - It's about a single path that is has 2 wd values, i.e., a subdirectory path that was created again before the "bookkeeping removal" event (IN_IGNORE) of a deletion was processed - The test is using a stochastical approach to reach the bug, in the sense that being "fast" isn't enough to enforce a particular event order; however, a "lucky" event synchronization seems extremely rare and the package should pass on every case - Even with an unknown order for the events, the test is counting and enforces: - Watchdog emits the 120 events that happened - Specific number of events for each type - Order constraing as required for minimal consistency (e.g. not deleting a directory that wasn't created)
- The call on inotify_event.is_ignored was removing the wrong wd, due to another wd with the same path (self._wd_for_path[src_path] was replaced) - Fix gorakhargosh#117 and gorakhargosh#233 - Still not enough to fix every bug regarding fast/unordered events, but doesn't crash anymore
Inotify event order/duplication, fix gorakhargosh#117 and gorakhargosh#233
Hi!
I keep getting this exception while executing the following command
I'm on version 0.7.1.
Do you need more information?
The text was updated successfully, but these errors were encountered: