diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/DownloadAndImportReplicator.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/DownloadAndImportReplicator.java index 3100a684caf..eef01a13f2f 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/DownloadAndImportReplicator.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/DownloadAndImportReplicator.java @@ -95,13 +95,12 @@ public class DownloadAndImportReplicator implements ContainerReplicator { LOG.error( "Can't import the downloaded container data id=" + containerID, e); + } finally { try { Files.delete(tarFilePath); } catch (Exception ex) { - LOG.error( - "Container import is failed and the downloaded file can't be " - + "deleted: " - + tarFilePath.toAbsolutePath().toString()); + LOG.error("Got exception while deleting downloaded container file: " + + tarFilePath.toAbsolutePath().toString(), ex); } } }