-
Notifications
You must be signed in to change notification settings - Fork 26.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About the application of spring management repeated monitoring processing dubbo shutdown #7420
Conversation
…onitoring processing dubbo shutdown.
…onitoring processing dubbo shutdown.
…onitoring processing dubbo shutdown.
Codecov Report
@@ Coverage Diff @@
## master #7420 +/- ##
============================================
+ Coverage 58.71% 59.06% +0.35%
- Complexity 422 456 +34
============================================
Files 1043 1043
Lines 42514 42524 +10
Branches 6208 6226 +18
============================================
+ Hits 24962 25117 +155
+ Misses 14769 14619 -150
- Partials 2783 2788 +5 Continue to review full report at Codecov.
|
There seems to be a problem with the stop logic. The Shutdown hook is called by the JVM before the JVM exits. It is not good to wait for the dubbo shutdown hook to complete in the Spring close event. Actually Spring also registered shutdown hook, please check org.springframework.context.support.AbstractApplicationContext#registerShutdownHook().
|
Now it is precisely because of the existence of Spring hook and Dubbo Hook. As a result, Spring did not block when closing dubbo, and then continued to execute the destruction of Spring Bean. At this time, Dubbo has not completed the destruction, which will cause the database connection not to be obtained. It may be a way to cancel Dubbo Hook directly after hosting to the Spring container. |
For clarity of responsibilities, the processing logic of dubbo destroy should extracted from the Dubbo shutdown hook, and called it separately in the Spring scenario without relying on the Dubbo shutdown hook. |
So when shutting down the Dubbo service in Spring, do you tend to cancel the registration of DubboShutDownHook? |
What is the purpose of the change
About the application of spring management repeated monitoring processing dubbo shutdown.
see more detail from #7093
Brief changelog
XXXXX
Verifying this change
XXXXX
Follow this checklist to help us incorporate your contribution quickly and easily:
[Dubbo-XXX] Fix UnknownException when host config not exist #XXX
. Each commit in the pull request should have a meaningful subject line and body.mvn clean install -DskipTests=false
&mvn clean test-compile failsafe:integration-test
to make sure unit-test and integration-test pass.