Skip to content

refactor(watch): detect filesystem changes with fsbroker - #3064

Open
andreynering wants to merge 1 commit into
mainfrom
fsbroker
Open

andreynering wants to merge 1 commit into
mainfrom
fsbroker

Conversation

@andreynering

@andreynering andreynering commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

This patch migrates our watched from fsnotify to fsbroker.

fsbroken is a wrapper around fsnotify that 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:


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

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
@andreynering
andreynering requested review from pd93 and vmaerten October 6, 2026 15:51
@andreynering andreynering self-assigned this Oct 6, 2026
@andreynering andreynering added the area: watcher Changes related to the Taskfile watcher. label Oct 6, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: watcher Changes related to the Taskfile watcher.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant