Prevent fsnotifier on running on a directory/mount?


There's a number of posts about getting fsnotifier  to work on network mounts, I have an opposite problem.

I have a symlink in the project directory to an overlayfs mount, which itself overlays an sshfs mount, which mounts a very large directory on hard drives on a very slow computer :)

It needs to be there because unfortunately it (the directory) is hardcoded to be there. Also, I do sometimes want to access it from IDEA.

However I don't need to watch it for changes and I most definitely don't want fsnotifier doing a full scan of it on every run, which it does attempt (I don't think it ever finished), and even worse, it starts scanning that directory before getting to any actual things I do want to watch, so all useful notification functionality is broken.

It is marked as excluded, and all the subdirectories in it are marked as excluded for good measure, this doesn't seem to have any effect. Is there any way at all to pass any options to fsnotifier to ignore it completely?


Consider disabling fsnotifier completely by adding -Didea.filewatcher.disabled=true in Help | Edit Custom VM Options.

There doesn't seem to be a way to exclude folders via options to the fsnotifier (or the way to pass options manually).

Watching excluded folders looks like a bug (unless this folder is added a library somewhere in your project). Related issue: .


(after two edits) chmod -r on the directory itself seems sufficient to prevent any scanning of it, by fsnotifier or otherwise. In this case it is a better option than disabling it altogether.

I don't think it's included in any way other than the symlink (and removing it also “solved” the issue, so it's certainly that one place triggering it). I wondered if the issue was with it being a symlink (so perhaps it resolves to an absolute path outside of the project which is therefore not excluded) but I replaced it with a bind mount and that didn't change anything.

So yep, I guess it is related to that bug. But really there should be at least some way to configure stuff like that.


Unfortunately, there is no option to configure the fsnotifier behavior in our IDE for your use case.

Please vote for for updates. (When a folder is excluded from the project, is still tracked by file watcher (fsnotifier / inotify))

If we fix this issue, it should cover your use case too.


There are some other workarounds:

* A workaround shared in IJPL-2175's description.
* Select `Help | Find Action` from the main menu, type `Registry...`, select it and in the opened list, find and disable the `indexer.follows.symlinks` options here though it would disable the scanning/indexing for all symlink files.


Please sign in to leave a comment.