You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2019/12/31 02:09:26 UTC

[GitHub] [incubator-dolphinscheduler] Technoboy- commented on a change in pull request #1649: fix "wait(...)" should be used instead of "Thread.sleep(...)" when a lock is held

Technoboy- commented on a change in pull request #1649: fix "wait(...)" should be used instead of "Thread.sleep(...)" when a lock is held
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1649#discussion_r362135456
 
 

 ##########
 File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/master/MasterServer.java
 ##########
 @@ -176,14 +176,12 @@ public synchronized void stop(String cause) {
 
             logger.info("master server is stopping ..., cause : {}", cause);
 
-            // set stop signal is true
-            Stopper.stop();
+            while (!Stopper.isStoped()) {
+                // set stop signal is true
+                Stopper.stop();
 
-            try {
                 //thread sleep 3 seconds for thread quitely stop
-                Thread.sleep(3000L);
-            }catch (Exception e){
-                logger.warn("thread sleep exception:" + e.getMessage(), e);
+                this.wait(3000L);
 
 Review comment:
   Did you get the lock ? or did you test your code ?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services