wcmolin opened a new issue #8230:
URL: https://github.com/apache/dolphinscheduler/issues/8230


   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   When I use `IntelliJ IDEA` to debug the `MasterServer`, I try to stop it and 
it doesn't always stop. After my debugging, I found that at the end of the 
`close` method in the class `MasterServer`, there is a line of 
`System.exit(1)`. If I comment it out, I can successfully stop the service. I 
tested the binary version of the service again and got the same problem, 
because it took too long to stop and was force-killed with the `kill -9` 
command.
   ```
   [dolphinscheduler@slave1 dolphinscheduler]$ sh bin/stop-all.sh
   192.168.0.98:default
   192.168.0.98 master server is stopping
   Begin stop master-server......
   stopping master-server
   master-server did not stop gracefully after 70 seconds: killing with kill -9
   End stop master-server.
   192.168.0.98 worker server is stopping
   Begin stop worker-server......
   stopping worker-server
   worker-server did not stop gracefully after 70 seconds: killing with kill -9
   End stop worker-server.
   Begin stop logger-server......
   stopping logger-server
   End stop logger-server.
   Begin stop alert-server......
   no alert-server to stop
   End stop alert-server.
   192.168.0.98 worker server is stopping
   Begin stop api-server......
   no api-server to stop
   End stop api-server.
   192.168.0.98 python gateway server is stopping
   Begin stop python-gateway-server......
   no python-gateway-server to stop
   End stop python-gateway-server.
   query server status
   ```
   
   environment: 
   - os: macOs Big Sur  11.5.2
   - jdk version: 1.8
   
   ### What you expected to happen
   
   The service is stopped gracefully
   
   ### How to reproduce
   
   
   1. Clone the source code and checkout to the `2.0.2-release` branch
   
   2. use the IntelliJ IDEA to open the project, debug the WorkerServer,
   
   3. click the stop button, wait for more than 60s, and the program still does 
not stop
   
   
   ### Anything else
   
   There should be this problem with versions over 2.0.2-release
   
   Here are two reference links:
   - 
[what-happens-if-system-exit-is-called-from-a-shutdown-hook](https://stackoverflow.com/questions/19552358/what-happens-if-system-exit-is-called-from-a-shutdown-hook)
   - 
[deadlock-in-java-shutdown-hook](https://stackoverflow.com/questions/25204615/deadlock-in-java-shutdown-hook)
   
   ### Version
   
   2.0.2
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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