RFR: 8114830: (fs) Files.copy fails due to interference from something else changing the file system [v7]

Alan Bateman alanb at openjdk.org
Thu Aug 10 02:33:58 UTC 2023


On Wed, 9 Aug 2023 16:28:01 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Throw a `FileSystemException` if attempting to create the target file with `O_EXCL` fails with `EEXIST`.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8114830: Correct toString() call

The src change looks fine.

I've done a pass over the test, it looks okay but it would be good to get another set of eyes (if possible) and some confidence that it doesn't fail with repeated runs.

test/jdk/java/nio/file/Files/CopyInterference.java line 77:

> 75:                 }
> 76:             } catch (FileAlreadyExistsException e) {
> 77:                 running.set(false);

The running.set(false) can be removed from the catch blocks.

test/jdk/java/nio/file/Files/CopyInterference.java line 95:

> 93:         Path parent = Path.of(System.getProperty("test.dir", "."));
> 94:         Path dir = Files.createTempDirectory(parent, "foobargus");
> 95:         dir.toFile().deleteOnExit();

I assume this doesn't actually delete because the directory is not empty. Maybe it can be just dropped.

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

Marked as reviewed by alanb (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15141#pullrequestreview-1570886086
PR Review Comment: https://git.openjdk.org/jdk/pull/15141#discussion_r1289447059
PR Review Comment: https://git.openjdk.org/jdk/pull/15141#discussion_r1289447784


More information about the nio-dev mailing list