RFR: 8330077: Allow max number of events to be buffered to be configurable to avoid OVERFLOW_EVENT [v5]
Fabian Meumertzheim
duke at openjdk.org
Tue Apr 16 06:13:31 UTC 2024
On Mon, 15 Apr 2024 17:29:22 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
> An `@implNote` about the property and its behavior could be added in `WatchService`.
I added the note to `WatchKey#poll` since that is what returns the list, but can also move it to `WatchService` as it is the more canonical API entrypoint.
> Once the property name, its behavior, and the `@implNote` are decided I can file the CSR.
Thanks!
> src/java.base/share/classes/sun/nio/fs/AbstractWatchKey.java line 57:
>
>> 55: intValue = Math.clamp(
>> 56: Long.decode(rawValue),
>> 57: DEFAULT_MAX_EVENT_LIST_SIZE,
>
> Probably we should allow positive values with no minimum. If it's zero or negative then I am not sure whether that would be an error.
Since 0 or -1 seem like pretty clear intent to "disable" watching as far as possible, I went with a clamp to 1 in that case. But I'm open to making that a hard error instead if you prefer that.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18739#issuecomment-2058302426
PR Review Comment: https://git.openjdk.org/jdk/pull/18739#discussion_r1566757762
More information about the nio-dev
mailing list