chungen0126 commented on code in PR #9173:
URL: https://github.com/apache/ozone/pull/9173#discussion_r2501512395
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ReconTaskControllerImpl.java:
##########
@@ -741,16 +744,16 @@ private void
processReInitializationEvent(ReconTaskReInitializationEvent event)
resetRetryCounters();
LOG.info("Completed async task reinitialization");
}
+
+ // Clean up checkpoint files after use (database connections are
automatically closed by try-with-resources)
+ cleanupCheckpointFiles(checkpointedOMMetadataManager);
Review Comment:
It's good to separate the file cleanup and the closing of
`ReconOmMetadataManagerImpl`, but the file cleanup should still be put in a
finally block to ensure it runs properly.
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/QuotaRepairTask.java:
##########
@@ -102,32 +102,33 @@ public static String getStatus() {
private boolean repairTask(List<String> buckets) {
LOG.info("Starting quota repair task {}", REPAIR_STATUS);
- OMMetadataManager activeMetaManager = null;
try {
// thread pool with 3 Table type * (1 task each + 3 thread for each task)
executor = Executors.newFixedThreadPool(3 * (1 + TASK_THREAD_CNT));
OzoneManagerProtocolProtos.QuotaRepairRequest.Builder builder
= OzoneManagerProtocolProtos.QuotaRepairRequest.newBuilder();
// repair active db
- activeMetaManager = createActiveDBCheckpoint(om.getMetadataManager(),
om.getConfiguration());
- repairActiveDb(activeMetaManager, builder, buckets);
+ try (OMMetadataManager activeMetaManager =
Review Comment:
There are too many nested try blocks. Could we declare the active DB
checkpoint in the existing try-with-resources?
--
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]