dineshchitlangia commented on code in PR #6352:
URL: https://github.com/apache/hadoop/pull/6352#discussion_r1552669244


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java:
##########
@@ -1118,38 +1123,36 @@ protected void serviceStop() throws Exception {
     }
   }
 
-    /**
+  /**
    * Transition to standby state in a new thread. The transition operation is
    * asynchronous to avoid deadlock caused by cyclic dependency.
    */
-  private void handleTransitionToStandByInNewThread() {
-    Thread standByTransitionThread =
-        new Thread(activeServices.standByTransitionRunnable);
-    standByTransitionThread.setName("StandByTransitionThread");
-    standByTransitionThread.start();
+  void handleTransitionToStandByInNewThread() {
+    toActiveStandbyExecutor.submit(
+        new RMFatalToStandbyRunner(ResourceManager.getClusterTimeStamp()));

Review Comment:
   Based on the spotbugs issue definition, L1131 returns a value that we are 
not checking. In theory, it may return a bad value and it could go unnoticed.
   
   In this case, you are using ExecutorService.submit() and that could 
potentially throw NPE or RejectedExecutionException.
   The method signature does not specify the `throws` definition. This could be 
a reason you have the spotbugs issue.
   
   Reference - 
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ExecutorService.html#submit(java.util.concurrent.Callable)
   
   
   Please modify the code here to accommodate the needs of submit().
   



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