镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Merged
andreynering merged 1 commit into
mainfrom
fsbroker
Nov 1, 2026
Merged

andreynering merged 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

@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
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 enabled auto-merge (squash) November 1, 2026 13:09
@andreynering
andreynering merged commit 847c439 into main Nov 1, 2026
24 checks passed
@andreynering
andreynering deleted the fsbroker branch November 1, 2026 13:11
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.

2 participants