duongkame commented on code in PR #4075:
URL: https://github.com/apache/ozone/pull/4075#discussion_r1062023240


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerDoubleBuffer.java:
##########
@@ -386,11 +389,14 @@ private void flushTransactions() {
               + "exit.", Thread.currentThread().getName());
         }
       } catch (IOException ex) {
-        terminate(ex);
+        terminate(ex, omResponse.get());
       } catch (Throwable t) {
-        final String s = "OMDoubleBuffer flush thread " +
-            Thread.currentThread().getName() + " encountered Throwable error";
-        ExitUtils.terminate(2, s, t, LOG);
+        StringBuilder s = new StringBuilder("OMDoubleBuffer flush thread " +

Review Comment:
   Guess if `OzoneManagerDoubleBuffer#terminate` took exitCode as a parameter, 
you'd just need to replace the entire thing here with `terminate(ex, 
omResponse.get(), 2); `



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerDoubleBuffer.java:
##########
@@ -276,9 +277,9 @@ private void flushTransactions() {
             AtomicReference<String> lastTraceId = new AtomicReference<>();
             readyBuffer.iterator().forEachRemaining((entry) -> {
               try {
-                OMResponse omResponse = entry.getResponse().getOMResponse();

Review Comment:
   nit: I don't think `omResponse` is used in any lambda. You probably just 
need to move this line to outside the try block (move up 2 lines). Another 
`AtomicReference ` is not needed. 



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