ashishkumar50 commented on code in PR #7349:
URL: https://github.com/apache/ozone/pull/7349#discussion_r1870779874


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/DirectoryDeletingService.java:
##########
@@ -158,7 +215,8 @@ public BackgroundTaskResult call() {
           LOG.debug("Running DirectoryDeletingService");
         }
         isRunningOnAOS.set(true);
-        getRunCount().incrementAndGet();
+        // rnCnt will be same for each thread to maintain same CallId.
+        long rnCnt = getRunCount().incrementAndGet();

Review Comment:
   Comment looks wrong. rnCnt is different for each request/thread and so 
CallId will be different which is correct.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/DirectoryDeletingService.java:
##########
@@ -135,10 +148,54 @@ public void resume() {
   @Override
   public BackgroundTaskQueue getTasks() {
     BackgroundTaskQueue queue = new BackgroundTaskQueue();
-    queue.add(new DirectoryDeletingService.DirDeletingTask(this));
+    if (taskCount.get() > 0) {
+      LOG.info("{} Directory deleting task(s) already in progress.",
+          taskCount.get());
+      return queue;
+    }
+    try {
+      deletedDirSupplier.reInitItr();
+    } catch (IOException ex) {
+      LOG.error("Unable to get the iterator.", ex);

Review Comment:
   In case of exception we don't need to continue to next statements, instead 
we need to return here.



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/DirectoryDeletingService.java:
##########
@@ -238,6 +295,7 @@ public BackgroundTaskResult call() {
         }
       }
       // place holder by returning empty results of this call back.
+      taskCount.getAndDecrement();

Review Comment:
   Better to do `taskCount.getAndDecrement();` in finally. I some en case of 
some exception it doesn't get decremented then from next time complete 
deletingservice will halt.



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