Making AbstractWatchKey#MAX_EVENT_LIST_SIZE tunable
Fabian Meumertzheim
fabian at buildbuddy.io
Wed Apr 10 15:35:15 UTC 2024
When using WatchService to watch a directory, the
AbstractWatchKey#MAX_EVENT_LIST_SIZE constant (value: 512) makes it so that
e.g. creating 1000 files in a single watched directory inevitably results
in an OVERFLOW event.
The build system Bazel (https://github.com/bazelbuild/bazel) relies on the
JVM's WatchService mechanism for all its file system watches on Linux.
Since many Bazel users work with big monorepos, they tend to get into
situations where switching Git branches causes the hard-coded limit to be
hit frequently.
The constant comes with a comment saying "(in the future this may be
tunable)". Would a contribution be welcome that makes this limit tunable
via a system property (or some other mechanism)?
Fabian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/nio-dev/attachments/20240410/208231ac/attachment-0001.htm>
More information about the nio-dev
mailing list