Making AbstractWatchKey#MAX_EVENT_LIST_SIZE tunable
Brian Burkhalter
brian.burkhalter at oracle.com
Wed Apr 10 16:07:44 UTC 2024
Hello Fabian,
Do you have any idea of how you might want to implement this or of how we might do it if we were to pick up the task? In any case, an enhancement issue should be filed [1].
Thanks,
Brian
[1] https://openjdk.org/guide/#filing-an-issue
On Apr 10, 2024, at 8:35 AM, Fabian Meumertzheim <fabian at buildbuddy.io> wrote:
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)?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/nio-dev/attachments/20240410/07f5aae3/attachment.htm>
More information about the nio-dev
mailing list