ruanwenjun commented on code in PR #10516:
URL: https://github.com/apache/dolphinscheduler/pull/10516#discussion_r901737687


##########
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java:
##########
@@ -88,24 +91,23 @@ public void close() {
     public void destroy(String cause) {
 
         try {
+            // set stop signal is true
             // execute only once
-            if (Stopper.isStopped()) {
+            if (!Stopper.stop()) {
+                logger.warn("AlterServer is already stopped");

Review Comment:
   I have changed this method to `compareAndSwap`,  so the stop method will 
only be executed successful only once.
   
   ```java
   /**
      * Stop the server
      *
      * @return True, if the server stopped success. False, if the server is 
already stopped.
      */
     public static boolean stop() {
         return stoppedSignal.compareAndSet(false, true);
     }
   ```



##########
dolphinscheduler-alert/dolphinscheduler-alert-server/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java:
##########
@@ -67,7 +70,7 @@ public static void main(String[] args) {
 
     @EventListener
     public void run(ApplicationReadyEvent readyEvent) {
-        logger.info("alert server starting...");
+        logger.info("Alert server is ready ...");

Review Comment:
   Done



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

Reply via email to