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/30 14:11:28 UTC

[GitHub] [incubator-dolphinscheduler] Jave-Chen opened a new pull request #1649: fix "wait(...)" should be used instead of "Thread.sleep(...)" when a lock is held

Jave-Chen opened a new 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
 
 
   ## What is the purpose of the pull request
   fix "wait(...)" should be used instead of "Thread.sleep(...)" when a lock is held
   issue #1648 
   
   ## Brief change log
   Modify Thread.sleep(...)  to this.wait(...)
   
   If Thread.sleep(...) is called when the current thread holds a lock, it could lead to performance and scalability issues, or even worse to deadlocks because the execution of the thread holding the lock is frozen. It's better to call wait(...) on the monitor object to temporarily release the lock and allow other threads to run.
   
   

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

[GitHub] [incubator-dolphinscheduler] Jave-Chen closed pull request #1649: fix "wait(...)" should be used instead of "Thread.sleep(...)" when a lock is held

Posted by GitBox <gi...@apache.org>.
Jave-Chen closed 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
 
 
   

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

[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

Posted by GitBox <gi...@apache.org>.
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

[GitHub] [incubator-dolphinscheduler] codecov-io commented on issue #1649: fix "wait(...)" should be used instead of "Thread.sleep(...)" when a lock is held

Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #1649: fix "wait(...)" should be used instead of "Thread.sleep(...)" when a lock is held
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1649#issuecomment-569690203
 
 
   # [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=h1) Report
   > Merging [#1649](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=desc) into [dev](https://codecov.io/gh/apache/incubator-dolphinscheduler/commit/a51242d445cfcc00086235f8e6b202c4c8577ebe?src=pr&el=desc) will **not change** coverage.
   > The diff coverage is `0%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/graphs/tree.svg?width=650&token=bv9iXXRLi9&height=150&src=pr)](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=tree)
   
   ```diff
   @@          Coverage Diff          @@
   ##             dev   #1649   +/-   ##
   =====================================
     Coverage   13.4%   13.4%           
   =====================================
     Files        282     282           
     Lines      13915   13915           
     Branches    2250    2250           
   =====================================
     Hits        1866    1866           
     Misses     11843   11843           
     Partials     206     206
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...e/dolphinscheduler/server/master/MasterServer.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci9NYXN0ZXJTZXJ2ZXIuamF2YQ==) | `0% <0%> (ø)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=footer). Last update [a51242d...1ea3dfb](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

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

[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

Posted by GitBox <gi...@apache.org>.
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

[GitHub] [incubator-dolphinscheduler] Jave-Chen commented on issue #1649: fix "wait(...)" should be used instead of "Thread.sleep(...)" when a lock is held

Posted by GitBox <gi...@apache.org>.
Jave-Chen commented on issue #1649: fix "wait(...)" should be used instead of "Thread.sleep(...)" when a lock is held
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1649#issuecomment-569691711
 
 
   Sonarcloud analysis failed, I will try later
   https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&issues=AW9XLB9iiXNHxY_17G-U&open=AW9XLB9iiXNHxY_17G-U&pullRequest=1649

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

[GitHub] [incubator-dolphinscheduler] codecov-io edited a comment on issue #1649: fix "wait(...)" should be used instead of "Thread.sleep(...)" when a lock is held

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #1649: fix "wait(...)" should be used instead of "Thread.sleep(...)" when a lock is held
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1649#issuecomment-569690203
 
 
   # [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=h1) Report
   > Merging [#1649](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=desc) into [dev](https://codecov.io/gh/apache/incubator-dolphinscheduler/commit/b73979360e91dccdd7e9761b6d3caa53ffce765a?src=pr&el=desc) will **increase** coverage by `<.01%`.
   > The diff coverage is `0%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/graphs/tree.svg?width=650&token=bv9iXXRLi9&height=150&src=pr)](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff            @@
   ##             dev    #1649      +/-   ##
   =========================================
   + Coverage   13.4%   13.41%   +<.01%     
   =========================================
     Files        282      282              
     Lines      13915    13913       -2     
     Branches    2250     2251       +1     
   =========================================
     Hits        1866     1866              
   + Misses     11843    11841       -2     
     Partials     206      206
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...e/dolphinscheduler/server/master/MasterServer.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci9NYXN0ZXJTZXJ2ZXIuamF2YQ==) | `0% <0%> (ø)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=footer). Last update [b739793...fdc5d94](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

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

[GitHub] [incubator-dolphinscheduler] codecov-io edited a comment on issue #1649: fix "wait(...)" should be used instead of "Thread.sleep(...)" when a lock is held

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #1649: fix "wait(...)" should be used instead of "Thread.sleep(...)" when a lock is held
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1649#issuecomment-569690203
 
 
   # [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=h1) Report
   > Merging [#1649](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=desc) into [dev](https://codecov.io/gh/apache/incubator-dolphinscheduler/commit/a51242d445cfcc00086235f8e6b202c4c8577ebe?src=pr&el=desc) will **increase** coverage by `<.01%`.
   > The diff coverage is `0%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/graphs/tree.svg?width=650&token=bv9iXXRLi9&height=150&src=pr)](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff            @@
   ##             dev    #1649      +/-   ##
   =========================================
   + Coverage   13.4%   13.41%   +<.01%     
   =========================================
     Files        282      282              
     Lines      13915    13913       -2     
     Branches    2250     2251       +1     
   =========================================
     Hits        1866     1866              
   + Misses     11843    11841       -2     
     Partials     206      206
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...e/dolphinscheduler/server/master/MasterServer.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci9NYXN0ZXJTZXJ2ZXIuamF2YQ==) | `0% <0%> (ø)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=footer). Last update [a51242d...fdc5d94](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

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

[GitHub] [incubator-dolphinscheduler] codecov-io edited a comment on issue #1649: fix "wait(...)" should be used instead of "Thread.sleep(...)" when a lock is held

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #1649: fix "wait(...)" should be used instead of "Thread.sleep(...)" when a lock is held
URL: https://github.com/apache/incubator-dolphinscheduler/pull/1649#issuecomment-569690203
 
 
   # [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=h1) Report
   > :exclamation: No coverage uploaded for pull request base (`dev@545a6ec`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
   > The diff coverage is `23.96%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/graphs/tree.svg?width=650&token=bv9iXXRLi9&height=150&src=pr)](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=tree)
   
   ```diff
   @@          Coverage Diff           @@
   ##             dev    #1649   +/-   ##
   ======================================
     Coverage       ?   17.48%           
   ======================================
     Files          ?      285           
     Lines          ?    13911           
     Branches       ?     2275           
   ======================================
     Hits           ?     2433           
     Misses         ?    11205           
     Partials       ?      273
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...inscheduler/alert/utils/EnterpriseWeChatUtils.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hbGVydC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZG9scGhpbnNjaGVkdWxlci9hbGVydC91dGlscy9FbnRlcnByaXNlV2VDaGF0VXRpbHMuamF2YQ==) | `0% <ø> (ø)` | |
   | [...er/server/worker/task/AbstractCommandExecutor.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL3dvcmtlci90YXNrL0Fic3RyYWN0Q29tbWFuZEV4ZWN1dG9yLmphdmE=) | `0% <ø> (ø)` | |
   | [...che/dolphinscheduler/alert/runner/AlertSender.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hbGVydC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZG9scGhpbnNjaGVkdWxlci9hbGVydC9ydW5uZXIvQWxlcnRTZW5kZXIuamF2YQ==) | `0% <ø> (ø)` | |
   | [...inscheduler/common/job/db/DB2ServerDataSource.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvY29tbW9uL2pvYi9kYi9EQjJTZXJ2ZXJEYXRhU291cmNlLmphdmE=) | `0% <ø> (ø)` | |
   | [...java/org/apache/dolphinscheduler/dao/AlertDao.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1kYW8vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvZGFvL0FsZXJ0RGFvLmphdmE=) | `3.38% <ø> (ø)` | |
   | [...he/dolphinscheduler/api/service/LoggerService.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvTG9nZ2VyU2VydmljZS5qYXZh) | `0% <ø> (ø)` | |
   | [...phinscheduler/api/service/DataAnalysisService.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvRGF0YUFuYWx5c2lzU2VydmljZS5qYXZh) | `0% <ø> (ø)` | |
   | [...uler/server/worker/log/SensitiveDataConverter.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL3dvcmtlci9sb2cvU2Vuc2l0aXZlRGF0YUNvbnZlcnRlci5qYXZh) | `0% <ø> (ø)` | |
   | [...he/dolphinscheduler/server/utils/ProcessUtils.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL3V0aWxzL1Byb2Nlc3NVdGlscy5qYXZh) | `0% <ø> (ø)` | |
   | [...olphinscheduler/common/job/db/SparkDataSource.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvY29tbW9uL2pvYi9kYi9TcGFya0RhdGFTb3VyY2UuamF2YQ==) | `0% <ø> (ø)` | |
   | ... and [78 more](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=footer). Last update [545a6ec...5bc16a9](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/1649?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

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