Integrated: 8310902: (fc) FileChannel.transferXXX async close and interrupt issues
Alan Bateman
alanb at openjdk.org
Thu Jun 29 05:45:09 UTC 2023
On Mon, 26 Jun 2023 17:14:15 GMT, Alan Bateman <alanb at openjdk.org> wrote:
> This change fixes a number of bugs with FileChannel.transferTo/transerFrom that arise when the source or target channel is closed, or the thread is interrupted, during the transfer. More specifically:
>
> - The direct implementations operate on the raw file descriptor and don't prevent the target/source channel from being closed during the transfer. For this PR, the direct transferTo is limited to cases where the target is a FileChannel or SocketChannel. It could be extended to other SelChImpl implementations (SinkChannel, DatagramChannel) if needed, but they are less interesting at this time.
>
> - The transferTo/transferFrom methods are specified to throw ClosedByInterruptException after closing both channels. This is implemented inconsistently, and leaves one channel open in several cases.
This pull request has now been integrated.
Changeset: f4b900b6
Author: Alan Bateman <alanb at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/f4b900b607b2e857a0177d1e3061fd4dfc6b5f75
Stats: 850 lines in 3 files changed: 656 ins; 85 del; 109 mod
8310902: (fc) FileChannel.transferXXX async close and interrupt issues
Reviewed-by: bpb
-------------
PR: https://git.openjdk.org/jdk/pull/14656
More information about the nio-dev
mailing list