RFR: 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases [v5]

Alan Bateman alanb at openjdk.org
Tue Aug 26 06:55:38 UTC 2025


On Mon, 25 Aug 2025 23:13:28 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Throw `AsynchronousCloseException` from `FileChannelImpl` methods if the channel is uninterruptible and was closed before the method (operation) could complete.
>
> Brian Burkhalter has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
> 
>  - 8361495: Rename test and improve as suggested
>  - Merge
>  - 8361495: Remove commented out code and low value print statement
>  - 8361495: Add read and write tests and convert to JUnit 5
>  - 8361495: Clean up initial test
>  - 8361495: (fc) Async close of streams connected to uninterruptible FileChannel doesn't throw AsynchronousCloseException in all cases

test/jdk/java/nio/channels/Channels/AsyncCloseStreams.java line 85:

> 83:                     available = in.available();
> 84:                 } catch (AsynchronousCloseException ace) {
> 85:                     System.out.println("AsynchronousCloseException caught");

JUnit prints to stderr so this trace message won't be inlined with the test.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26435#discussion_r2299971909


More information about the nio-dev mailing list