RFR: 8305596: (fc) Two java/nio/channels tests fail after JDK-8303260

Brian Burkhalter bpb at openjdk.org
Wed Apr 5 14:48:17 UTC 2023


On Wed, 5 Apr 2023 08:27:22 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Update the tests to conform to the specification change in  [JDK-8303260](https://bugs.openjdk.org/browse/JDK-8303260) which allows writing to a position beyond the channel's size in `FileChannel::transferFrom`.
>
> test/jdk/java/nio/channels/AsyncCloseAndInterrupt.java line 474:
> 
>> 472:                 } else if ((test == TEST_INTR || test == TEST_PREINTR)
>> 473:                         && (op == TRANSFER_FROM)) {
>> 474:                     // Let these cases pass -- CBIE applies to other channel
> 
> Would it be possible to explain why this didn't happen before? The file channel position is 0 and I think transferFrom is called to transfer up to 1MB from a pipe source. The method is called with the interrupt status set so attempting to read from the pipe source will throw ClosedByInterruptException. I'm wondering what this didn't happen before your change.

transferFrom() simply returned and so never got to reading from the source.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13342#discussion_r1158626296


More information about the nio-dev mailing list