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:
[email protected]
With regards,
Apache Git Services