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

Brian Burkhalter bpb at openjdk.org
Wed Apr 17 20:33:01 UTC 2024


On Wed, 17 Apr 2024 06:49:16 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:
> 
>   Move `@implNote`

src/java.base/share/classes/java/nio/file/WatchService.java line 111:

> 109:  * StandardWatchEventKinds#OVERFLOW OVERFLOW} event.
> 110:  *
> 111:  * @since 1.7

@fmeum What do you think of this slightly modified version of the implementation note?


 * @implNote
 * In the reference implementation, the maximum size of the list of events
 * returned by {@link WatchKey#pollEvents() WatchKey.pollEvents} is controlled
 * by the system property {@code jdk.nio.file.WatchService.maxEventsPerPoll}.
 * If this property is not set or cannot be parsed as an integer, then the
 * maximum event list size will be set to 512; if the property is parsed as a
 * non-positive integer, then the maximum event size will be {@code 1} (unity).
 * If more events occur than the maximum size of the event list, the pending
 * events are cleared and replaced with a single
 * {@link StandardWatchEventKinds#OVERFLOW OVERFLOW} event.
 *

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

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


More information about the nio-dev mailing list