chungen0126 commented on code in PR #11547:
URL: https://github.com/apache/ozone/pull/11547#discussion_r4493597066
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerReader.java:
##########
@@ -103,6 +108,29 @@ public void run() {
}
}
+ private void cleanupContainerCopyDir() {
+ // Startup loads containers before starting the replication server, so no
imports can be in progress here.
+ try {
+ File copyDir = ContainerImporter.getUntarDirectory(hddsVolume).toFile();
+ if (copyDir.exists()) {
+ File[] files = copyDir.listFiles();
+ if (files == null) {
+ throw new IOException("Failed to list " + copyDir);
+ }
+ for (File file : files) {
+ try {
+ FileUtils.forceDelete(file);
+ } catch (IOException | RuntimeException e) {
+ LOG.warn("Failed to remove leftover container import file {}",
file.getAbsolutePath(), e);
Review Comment:
I suggest not to log exception. It will be to long.
--
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]