virajjasani commented on code in PR #5452:
URL: https://github.com/apache/hadoop/pull/5452#discussion_r1132896769


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/JavaKeyStoreProvider.java:
##########
@@ -640,6 +640,10 @@ private void revertFromOld(Path oldPath, boolean 
fileExisted)
   private void renameOrFail(Path src, Path dest)
       throws IOException {
     if (!fs.rename(src, dest)) {
+      if (!fs.exists(src)) {
+        throw new FileNotFoundException(src.toUri().toString());
+      }

Review Comment:
   How about keeping this check just before `fs#rename`? Could save efforts of 
doing rename in the first place?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to