RFR: 8330077: Allow max number of events to be buffered to be configurable to avoid OVERFLOW_EVENT [v10]
Brian Burkhalter
bpb at openjdk.org
Tue Apr 30 01:42:15 UTC 2024
On Fri, 19 Apr 2024 11:58:15 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Fabian Meumertzheim has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Revert test parameters and add debug output to test
>
> src/java.base/share/classes/sun/nio/fs/AbstractWatchKey.java line 58:
>
>> 56: Long.decode(rawValue),
>> 57: 1,
>> 58: ArraysSupport.SOFT_MAX_ARRAY_LENGTH);
>
> The use of ArraysSupport.SOFT_MAX_ARRAY_LENGTH to limit the value seems a bit overkill here. It's okay, just overkill.
I am also okay with it. This might be a little simpler, however:
static final int MAX_EVENT_LIST_SIZE;
static {
int intValue = DEFAULT_MAX_EVENT_LIST_SIZE;
String rawValue = GetPropertyAction.privilegedGetProperty
("jdk.nio.file.WatchService.maxEventsPerPoll");
if (rawValue != null) {
try {
intValue = Integer.decode(rawValue);
if (intValue <= 0)
intValue = 1;
} catch (NumberFormatException ignored) {
}
}
MAX_EVENT_LIST_SIZE = intValue;
}
Given that a lot of tests have already been run, it might be better just to go with 0703b3f499ee32a7efd780745c42b42131dfef85. I will plan to approve that tomorrow unless there is an objection.
As the CSR was approved, once the review is done, this can be integrated and then we will sponsor it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18739#discussion_r1584020339
More information about the nio-dev
mailing list