ChenSammi commented on code in PR #8239:
URL: https://github.com/apache/ozone/pull/8239#discussion_r2052186320
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerService.java:
##########
@@ -461,20 +480,23 @@ public BackgroundTaskResult call() {
totalBalancedBytes.addAndGet(containerSize);
} catch (IOException e) {
moveSucceeded = false;
+ LOG.warn("Failed to move container {}", containerData, e);
if (diskBalancerTmpDir != null) {
try {
- Files.deleteIfExists(diskBalancerTmpDir);
+ File dir = new File(String.valueOf(diskBalancerTmpDir));
+ org.apache.commons.io.FileUtils.deleteDirectory(dir);
} catch (IOException ex) {
LOG.warn("Failed to delete tmp directory {}", diskBalancerTmpDir,
ex);
}
}
if (diskBalancerDestDir != null) {
try {
- Files.deleteIfExists(diskBalancerDestDir);
+ File dir = new File(String.valueOf(diskBalancerDestDir));
+ org.apache.commons.io.FileUtils.deleteDirectory(dir);
} catch (IOException ex) {
LOG.warn("Failed to delete dest directory {}: {}.",
- diskBalancerDestDir, ex.getMessage());
+ diskBalancerDestDir, ex);
Review Comment:
When ex.getMessage() is removed, you need to remove one "{}" too.
--
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]