Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fuchsia-repo] Rewrite FS notification
This patch accounts for a number of complications we've discovered with the notify library. First, some notify backends may emit multiple notifications for the same event. For exampls, FSEvents on OSX will emit at least a create, modify-metadata, and modify-data events. Second, the event ordering can be somewhat non-deterministic. This can happen because the underlying notification system may also batch multiple events together. For example, on FSEevents, removing-then-recreating a file can emit a single event that has a bitfield that has a "delete" and "create" event. The notify library will unroll this into two separate events, but it doesn't have any way to tell the ordering of these events. To help deal with this, this patch creates a "notify-batch-watcher", which will batch up multiple events that occur over a period of time. We also drop the precise event kind. If it turns out we need this, we could add a bitflag field in the future. Finally, this refactors `PackageManifestWatcher` to use the helper library, and to simplify the tests to be quite a bit simpler. Note that this also removes the code accounting for notify-rs/notify#337, which was fixed in notify-5.0.0. Fixed: 117968 Change-Id: I3ac82308f38cb65e4b3d8bf5a50eacb55515f79b Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/794836 Reviewed-by: Gary Bressler <geb@google.com> Commit-Queue: Erick Tryzelaar <etryzelaar@google.com> Reviewed-by: Ben Keller <galbanum@google.com> Fuchsia-Auto-Submit: Erick Tryzelaar <etryzelaar@google.com>
- Loading branch information