[9] [XS] RFR 8138819 : File descriptors leak during construction of selector

Ivan Gerasimov ivan.gerasimov at oracle.com
Mon Oct 5 13:40:50 UTC 2015


Thanks Alan!

On 05.10.2015 16:24, Alan Bateman wrote:
>
> On 05/10/2015 14:08, Ivan Gerasimov wrote:
>> Hello!
>>
>> When constructing different kinds of Selector, a pair of file 
>> descriptors (the pipe ends) are created.
>> If later in the constructor an exception is thrown, these will remain 
>> open.
>> Would you please help review the fix?
>>
>> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8138819
>> WEBREV: http://cr.openjdk.java.net/~igerasim/8138819/00/webrev/
>
> (I've just changed the synopsis on this bug as the original synopsis 
> was misleading. Can you use the new synopsis for the change-set 
> message?).
>
Yes, sure.  Thank your for correcting it.

> The patch looks okay although if OOME is thrown then I assume the 
> addSuppressed might fail.
>
It that case one OOME will be replaces with another with a slightly 
different stack trace.
As this situation would be extremely rare, I'm not sure it worth 
complicating the code.

Sincerely yours,
Ivan

> I was going to suggest we create the wrapper before the socket pair so 
> that the rollback is one close rather than two but it's probably not 
> worth it.
>
> -Alan.
>
>
>



More information about the nio-dev mailing list