RFR: JDK-8327468: Do not restart close if errno is EINTR [macOS/linux]

Matthias Baesken mbaesken at openjdk.org
Fri Mar 8 12:14:52 UTC 2024


On Fri, 8 Mar 2024 10:24:54 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> There are a number of places remaining in the linux/macOS native JDK codebase where we use the RESTARTABLE macro with close, but this is unwanted on Linux/macOS.
>
> src/jdk.attach/linux/native/libattach/VirtualMachineImpl.c line 200:
> 
>> 198:     if (res == -1) {
>> 199:         JNU_ThrowIOExceptionWithLastError(env, "close");
>> 200:     }
> 
> I assume it would be better to not throw when errno is EINTR. If there is a profiler or some other tool firing signals at threads then there isn't anything that can be done here.

Should I just ignore the result / return code of close and avoid throwing an exception completely ?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18164#discussion_r1517639119


More information about the serviceability-dev mailing list