RFR: 8265261: java/nio/file/Files/InterruptCopy.java fails with java.lang.RuntimeException: Copy was not interrupted [v5]

Brian Burkhalter bpb at openjdk.java.net
Tue Aug 24 00:34:25 UTC 2021


On Tue, 24 Aug 2021 00:30:48 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> This proposal suggests to change the timing of testing whether a file copy is terminated by an interrupt.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8265261: Reinstate duration check and latches but with countdown 1

Version 04 revives the use of `CountDownLatch` but with a count of `1` instead of `2`. It is used for both the interrupt and the cancel cases to make the interrupting thread wait until just before `copy()` before the interrupting thread starts its sleep delay. For the interrupt case, a minimum duration for copying leading to a test failure is reinstated. This tries to prevent a false failure if the copy was much faster than expected.

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

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


More information about the nio-dev mailing list