RFR: 8330077: Allow max number of events to be buffered to be configurable to avoid OVERFLOW_EVENT [v3]

Brian Burkhalter bpb at openjdk.org
Thu Apr 11 21:55:41 UTC 2024


On Thu, 11 Apr 2024 21:50:57 GMT, Fabian Meumertzheim <duke at openjdk.org> wrote:

>> The limit on the number of events buffered for a single `j.n.f.WatchKey` is now configurable via the `sun.nio.fs.maxWatchEvents`.
>
> Fabian Meumertzheim has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Clamp to [512, Integer.MAX_VALUE]

src/java.base/share/classes/sun/nio/fs/AbstractWatchKey.java line 52:

> 50:         int intValue;
> 51:         try {
> 52:             intValue = Math.clamp(

`Math.clamp` is definitely better than the bloated nonsense I had: good catch.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18739#discussion_r1561796726


More information about the nio-dev mailing list