[crac] RFR: 8369394: [CRaC] java.nio.channels.ClosedSelectorException in sun.nio.ch.SelectorImpl.ensureOpen
Roman Marchenko
rmarchenko at openjdk.org
Wed Oct 8 14:45:29 UTC 2025
On Wed, 8 Oct 2025 08:53:41 GMT, Radim Vansa <rvansa at openjdk.org> wrote:
>> Suppress `RuntimeException` as it can be thrown by `Selector.select()` method.
>
> src/java.base/linux/classes/sun/nio/ch/EPollSelectorImpl.java line 89:
>
>> 87: try {
>> 88: selector.select(1);
>> 89: } catch (IOException | RuntimeException e) {
>
> I am worried that suppressing exceptions beyond `ClosedSelectorException` could hide a future underlying problem. Do you have a strong reason to suppress also NPEs, for instance?
I have no strong reasons, I was thinking it could throw RuntimeException derived exceptions, like IllegalStateException, IllegalArgumentException, and ClosedSelectorException, so we can suppress them all, as it is just a "push" for a Selector here.
But you're right, we could miss something important doing this way, so I can replace it with ClosedSelectorException.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/267#discussion_r2414105295
More information about the crac-dev
mailing list