markbates/refresh

Allow for the Watcher to poll the file system

Closed this issue · 0 comments

Unfortunately, inotify is not implemented sufficiently in the docker ecosystem to be the only available option for refresh:

Problem Statement: Docker for Windows running inside of Hyper-V mounts shared volumes using Samba/CIFS. Unfortunately, the CIFS implementation in the linux kernel doesn't support inotify events.

There are more examples that aren't just Windows specific (including some legacy Docker for Mac issues that have since been patched) that I won't list here, but it's important to highlight that inotify is great when available, but cannot be relied upon.

There is an outstanding issue on the fsnotify project since 2014 about addressing this through their package, but I doubt there will be any meaningful traction on the issue, so we should patch it here first imo.

Examples of others solving this similarly:

  • smartystreets/goconvey uses polling exclusively, allowing them to sidestep the "too many files" error, and work agnostic of inotify/fsnotify.
  • docker describes a FileWatcher interface that allows them to leverage fsnotify or their poller

Implementation examples:

It seems since moby/moby has exposed filenotify as a pkg, it's probably in best interest to leverage that package. Either vendoring this, or bringing it in as a third party seems like the best of both worlds.