You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "laeubi (via GitHub)" <gi...@apache.org> on 2023/02/24 15:25:48 UTC

[GitHub] [maven-resolver] laeubi commented on a diff in pull request #257: [MRESOLVER-329] More robust IO in DefaultTrackingFileManager

laeubi commented on code in PR #257:
URL: https://github.com/apache/maven-resolver/pull/257#discussion_r1117182543


##########
maven-resolver-util/src/main/java/org/eclipse/aether/util/FileUtils.java:
##########
@@ -105,7 +106,16 @@ public Path getPath() {
 
             @Override
             public void move() throws IOException {
-                Files.move(tempFile, file, StandardCopyOption.ATOMIC_MOVE);
+                try {
+                    Files.move(tempFile, file, StandardCopyOption.ATOMIC_MOVE);

Review Comment:
   As mentioned in the other PR this is likely not what one wants. If the (atomic) move do not succeeds, there is no guarantee that the file has not changed (deleted, modified, ...) so retry the move will simply ignore this and overwrite everything. So callers of the move operation must retry the full operation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org