I’ve encountered an issue related to syncthing while using ksync. ksync is the tool that syncs local directory with the container in kubernetes cluster. It uses syncthing as the workhorse backend.
So we can assume that actual schema is: windows machine (C:/code) <-> linux machine (/var/www/code)
Initial sync works well, but there is an issue with file changes watcher.
When I create or change files on the linux box everything works as expected - all changes synchronized as soon as they were made. But when I try to do the same on windows strange things happen. When I create or delete directory - it syncs instanteniously, but when I create or modify file - no changes are detected and thus no synchronization is performed. File changes are synced only when full synchronization time comes. I’ve enabled debug logging along with file operations and filesystem watcher and it indirectly confirms my assumption: watcher reacts only to directories events.
I have about 18K files in various nested subdirs in this malfunctioning setup. When I tried to sync empty dirs - everything works as expected - file changes are detected from the both sides.
So I suppose, there is some limit in windows that prevents syncthing from functioning correct.
In linux we have some tunables like a fs.inotify.max_user_watches. Do we have something like that on windows?