Repository navigation
refactor(watch): detect filesystem changes with fsbroker - #3064
Open
andreynering wants to merge 1 commit into
Open
andreynering wants to merge 1 commit into
andreynering wants to merge 1 commit into
Conversation
Watching relied on raw fsnotify events plus a hand-rolled deduplicator, so the meaning of a change had to be guessed from event flags. That left real gaps: renaming or deleting a source file did not rerun the task, files created in a directory that appeared after watching started were invisible until the next periodic rescan, and a burst of edits could rerun a task once per event. Task now receives interpreted actions (create, write, rename, remove) and registers watches for new directories as soon as they appear, so those cases rerun the task right away. A burst of changes is coalesced into a single rerun, and changes that are not part of a task's sources no longer interrupt a run already in progress. The deduplicator is no longer needed and was removed. Assisted-by: Crush:prism
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch migrates our watched from
fsnotifytofsbroker.fsbrokenis a wrapper aroundfsnotifythat deduplicate events and do some extra work to normalize behavior between different operating systems, etc.We had a deduplicator before, but it wasn't as good as
fsbroker's one.Follow-up PRs:
AddWatchregistering entries with the directory's stat helshabini/fsbroker#9Watching relied on raw fsnotify events plus a hand-rolled deduplicator, so the meaning of a change had to be guessed from event flags. That left real gaps: renaming or deleting a source file did not rerun the task, files created in a directory that appeared after watching started were invisible until the next periodic rescan, and a burst of edits could rerun a task once per event.
Task now receives interpreted actions (create, write, rename, remove) and registers watches for new directories as soon as they appear, so those cases rerun the task right away. A burst of changes is coalesced into a single rerun, and changes that are not part of a task's sources no longer interrupt a run already in progress. The deduplicator is no longer needed and was removed.
Assisted-by: Crush:prism