RFR: 8366298: FDLeakTest sometimes takes minutes to complete on Linux [v2]

Stefan Karlsson stefank at openjdk.org
Fri Aug 29 09:04:44 UTC 2025


On Fri, 29 Aug 2025 08:22:05 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add error logging
>
> test/jdk/java/lang/ProcessBuilder/FDLeakTest/libFDLeaker.c line 54:
> 
>> 52:   if (ret != 0) {
>> 53:     return JNI_ERR;
>> 54:   }
> 
> Hmm, if the JVM already has opened > 100 fds at this point, we get difficult to understand errors. Any future open etc call will fail.
> 
> What I would do is to check, after the call to fopen() at line 39, check for errno==EMFILE. If that is true, write out a clear error message along the lines of "more than 100 files open?" (since that in itself would be worth to investigate; this little test should not open > 100 files, but who knows).

OK. I've added error logging for both setting the limit and opening the file. I didn't check specifically for EMFILE, but I hope that's fine?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26979#discussion_r2309606497


More information about the core-libs-dev mailing list