You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The FileWatcher was skipping DELETE events, except on very weird cases
where the file was deleted and re-created just before the event was
triggered by awatch().
This also extends the integration test to test both situations (delete
events when a file exist and when it doesn't).
Because there is usually a considerable delay between a change in the
filesystem happens and awatch() emits an event it is difficult to decide
if we should filter events based on the file existing or not. For
example, if a create event is received but before is triggered the file
was removed, should we emit the create event or not? Or the other way
around, should we emit a delete event if a file was created again before
the event was triggered.
It is probably best to leave this decision to the user, and let them
deal with races.
Signed-off-by: Leandro Lucarella <[email protected]>
Copy file name to clipboardExpand all lines: RELEASE_NOTES.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Summary
4
4
5
-
This release adds support to pass `None` values via channels and revamps the `Timer` class to support custom policies for handling missed ticks and use the loop monotonic clock.
5
+
This release adds support to pass `None` values via channels and revamps the `Timer` class to support custom policies for handling missed ticks and use the loop monotonic clock. There is also a fix for the `FileWatcher` which includes a change in behavior when reporting changes for deleted files.
6
6
7
7
## Upgrading
8
8
@@ -31,6 +31,14 @@ This release adds support to pass `None` values via channels and revamps the `Ti
31
31
32
32
**Note:** Before replacing this code blindly inall uses of `Timer.timeout()`, please consider using the periodic timer constructor `Timer.periodic()`if you need a timer that triggers reliable on a periodic fashion, as the old `Timer` (and`Timer.timeout()`) accumulates drift, which might not be what you want.
33
33
34
+
*`FileWatcher` now will emit events even if the file doesn't exist anymore.
35
+
36
+
Because the underlying library has a considerable delay in triggering filesystem events, it can happen that, for example, a `CREATE` event is received but at the time of receiving the file doesn't exist anymore (because if was removed just after creation and before the event was triggered).
37
+
38
+
Before the `FileWatcher` will only emit events when the file exists, but this doesn't work for `DELETE` events (clearly). Given the nature of this mechanism can lead to races easily, it is better to leave it to the user to decide when these situations happen and just report all events.
39
+
40
+
Therefore, you should now check a file receiving an event really exist before trying to operate on it.
41
+
34
42
## New Features
35
43
36
44
*`util.Timer` was replaced by a more generic implementation that allows for customizable policies to handle missed ticks.
@@ -40,3 +48,7 @@ This release adds support to pass `None` values via channels and revamps the `Ti
40
48
## Bug Fixes
41
49
42
50
*`util.Select`/`util.Merge`/`util.MergeNamed`: Cancel pending tasks in`__del__` methods only if possible (the loop isnot already closed).
51
+
52
+
*`FileWatcher` will now report `DELETE` events correctly.
53
+
54
+
Due to a bug, before this release `DELETE` events were only reported if the file was re-created before the event was triggered.
0 commit comments