Windows: fsnotify.Watcher.Add randomly hang with high volume file/folder
Author: StarAurryonCreated Sep 5, 2022Updated Jul 15, 2025
Labelsbugwindows
Describe the bug I am using fsnotify to monitor recursively file changes on Windows on more than 100k files and 24k folders. When reaching such threshold the Add method randomly hang after 200 calls.
To Reproduce Steps to reproduce the behavior:
- Walk the tree and add each file / folder, Add method will freeze after a while.
Expected behavior Supporting any amount of files / folder, going with 30k files and 5000 folders work as expected.
Which operating system and version are you using? Windows: 10.0.19044 N/A version 19044
Source: fsnotify/fsnotify