devmadhuu commented on code in PR #12203:
URL: https://github.com/apache/ozone/pull/12203#discussion_r4797715650


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/NSSummaryTask.java:
##########
@@ -262,6 +262,11 @@ public TaskResult reprocess(OMMetadataManager 
omMetadataManager) {
       LOG.error("NSSummary reprocess failed with exception.", e);
       REBUILD_STATE.set(RebuildState.FAILED);
       return buildTaskResult(false);
+    } catch (Error e) {
+      LOG.error("NSSummary reprocess failed with an error.", e);
+      // Do not leave the state RUNNING, or every later rebuild is skipped as 
already in progress.
+      REBUILD_STATE.set(RebuildState.FAILED);
+      throw e;

Review Comment:
   Could we move it after `REBUILD_STATE.set(RebuildState.FAILED)`? This catch 
block mainly handles `OutOfMemoryError`, and logging can throw again when 
memory is short. Then the state would stay `RUNNING`, which is the bug this PR 
fixes. Setting the state first keeps the fix reliable.
   ```
   } catch (Error e) {
     // Do not leave the state RUNNING, or every later rebuild is skipped as 
already in progress.
     REBUILD_STATE.set(RebuildState.FAILED);
     LOG.error("NSSummary reprocess failed with an error.", e);
     throw e;
   }
   ```



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