RFR: 8330077: Allow max number of events to be buffered to be configurable to avoid OVERFLOW_EVENT [v5]
Brian Burkhalter
bpb at openjdk.org
Thu Apr 18 15:33:59 UTC 2024
On Tue, 16 Apr 2024 06:09:24 GMT, Fabian Meumertzheim <duke at openjdk.org> wrote:
>> 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.
I think clamping to 1 is fine. An error hear might be awkward.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18739#discussion_r1570979183
More information about the nio-dev
mailing list