hanishakoneru commented on code in PR #3268:
URL: https://github.com/apache/ozone/pull/3268#discussion_r849885881


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/OzoneManagerSnapshotProvider.java:
##########
@@ -135,6 +135,12 @@ public DBCheckpoint getOzoneManagerDBSnapshot(String 
leaderOMNodeID)
 
       try (InputStream inputStream = httpURLConnection.getInputStream()) {
         FileUtils.copyInputStreamToFile(inputStream, targetFile);
+      } catch (IOException ex) {
+        boolean deleted = FileUtils.deleteQuietly(targetFile);
+        LOG.error("OM snapshot {} cannot be downloaded.", targetFile, ex);
+        if (!deleted) {
+          LOG.error("OM snapshot {} cannot be deleted", targetFile);

Review Comment:
   The log messages "OM snapshot cannot be deleted" could be confusing. Can we 
change the 2nd message to indicate that the "failed snapshot download" could 
not be deleted?



-- 
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