RFR: 8276779: (ch) InputStream returned by Channels.newInputStream should have fast path for SelectableChannels [v14]

Markus KARG duke at openjdk.java.net
Sun Nov 21 17:51:23 UTC 2021


On Sun, 21 Nov 2021 15:12:46 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>>> I sketched a possibly solution in [26ed670](https://github.com/openjdk/jdk/commit/26ed670be318669edf1ef9a7101c1136273f2b82), but looking at the PipeImpl internals I doubt that _all_ file descriptors actually get closed. To me it feels like this being actually a design flaw of PipeImpl: 
>> 
>> A Pipe creates a pair of channels. If you change to something the following then it will fix the issue:
>> 
>> 
>> Pipe pipe = Pipe.open();
>> try {
>>     :
>> } finally {
>>     pipe.source().close();
>>     pipe.sink().close();
>> }
>
> BTW: Would it possible to sync up your loom, it looks like hasn't been updated for some time.

> A Pipe creates a pair of channels. If you change to something the following then it will fix the issue:

Sure, I know. Did that in https://github.com/openjdk/jdk/pull/5179/commits/c4904cac46ab07355f0f21327c6909366c897b21. 

What I actually meant is: This is not apparent to the average Javadoc reader, so I propose to change PipeImpl to not run into this situation instead of asking all calling code to care for that.

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

PR: https://git.openjdk.java.net/jdk/pull/5179


More information about the nio-dev mailing list