You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@linkis.apache.org by "guoshupei (via GitHub)" <gi...@apache.org> on 2023/02/28 01:37:09 UTC

[GitHub] [linkis] guoshupei commented on a diff in pull request #4272: [bugfix] when executor is shutdown, the status is complete that send to linkimanager

guoshupei commented on code in PR #4272:
URL: https://github.com/apache/linkis/pull/4272#discussion_r1119487514


##########
linkis-computation-governance/linkis-engineconn/linkis-engineconn-executor/accessible-executor/src/main/scala/org/apache/linkis/engineconn/acessible/executor/service/DefaultAccessibleService.scala:
##########
@@ -92,15 +92,12 @@ class DefaultAccessibleService extends AccessibleService with Logging {
       return
     }
     var executor: Executor = ExecutorManager.getInstance.getReportExecutor
-    if (null != executor) {
-      Utils.tryAndWarn {
-        executor.close()
-        executor.tryShutdown()
-      }
-      logger.warn(s"Engine : ${Sender.getThisInstance} with state has stopped successfully.")
-    } else {
+    if (null == executor) {
       executor = SensibleExecutor.getDefaultErrorSensibleExecutor
     }
+    Utils.tryAndWarn(executor.tryShutdown())

Review Comment:
   No, the root cause is because first close, then tryShutdown. And It is logical to change the state (such as tryShutdown, tryFailed) first and then release the resource(such as close)
   OnceExecutor will be affected:
   ![image](https://user-images.githubusercontent.com/29919212/221729404-52da06b7-eba5-4544-a202-e79da0344dab.png)
   
   not OnceExecutor will not be affected:
   ![image](https://user-images.githubusercontent.com/29919212/221730031-d753baf2-3919-46fc-81ea-fa5c1bb2e850.png)
   
   



-- 
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: notifications-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org
For additional commands, e-mail: notifications-help@linkis.apache.org