haskell-fswatch / hfsnotify

Unified Haskell interface for basic file system notifications
BSD 3-Clause "New" or "Revised" License
136 stars 40 forks source link

Terminating steeloverseer+tmux triggers "Error removing watch:" #85

Open stites opened 5 years ago

stites commented 5 years ago

See schell/steeloverseer#34 for original issue. I've found that hfsnotify swallows errors from hinotify at System.FSNotify.Linux.hs#L113 which originally to require me to kill my tmux server as a workaround and then switch to entr. The bug can be seen here: https://asciinema.org/a/Em8NVKMw5gdxutQWU2NiiLApZ

I'm now finding that this outside of tmux has the same output -- even when I kill the tmux server. Somehow hfsnotify fails to catch the removal of watches. Currently building on NixOS with kernel 4.19.5. Originally, schell/steeloverseer#34 was present on Ubuntu. Also present in Ubuntu 18.04, kernel 4.15.0.

thomasjm commented 5 years ago

Thanks for the report. The errors you're seeing (in the tests at least) seem to be due to attempting to remove a watch after a file is already deleted, so may not represent a resource leak in and of itself (?). I'll poke around.

https://github.com/schell/steeloverseer/issues/34 looks to me like it might just be caused by hitting the watch limit. As a workaround you may be interested in increasing the number of inotify watches.

stites commented 5 years ago

I think I am seeing this when I simply exit the processes running hfsnotify (steeloverseer) -- I don't think this is deleting any files. The command I was running was latexmk, so it might be that overwriting the pdf was seen as a delete?

Another thought: on steeloverseer's master, which I'm using, it pulls in hinotify-0.4. Perhaps this is a bug introduced by the restructuring (see: https://github.com/kolmodin/hinotify/issues/4)?