RFR: 8274780: ChannelInputStream.readNBytes(int) incorrectly calls readAllBytes()

Florian Weimer fweimer at openjdk.java.net
Tue Oct 5 17:52:15 UTC 2021


On Tue, 5 Oct 2021 17:43:42 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> How important is exception correctness in the test code? Is it acceptable to leak resources on VM errors?
>
>> How important is exception correctness in the test code? Is it acceptable to leak resources on VM errors?
> 
> The tests usually run in agentvm mode so if failing tests leak then it may have knock impact to tests that run later in the same VM. So if we can clean up then we should.  Sometimes we have tests that can't reliably cleanup, they can run in othervm mode that is runs just the one test.

I meant whether it's acceptable to use a construct like `try (var ch = Channels.newInputStream(new FileInputStream(f)))`. The input stream could leak there, but only in case of VM errors.

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

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


More information about the nio-dev mailing list