Skip to content
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

[Bug] dubbo-2.7.22的优雅停机存一个bug #14488

Closed
4 tasks done
qq664042 opened this issue Aug 1, 2024 · 1 comment
Closed
4 tasks done

[Bug] dubbo-2.7.22的优雅停机存一个bug #14488

qq664042 opened this issue Aug 1, 2024 · 1 comment
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage

Comments

@qq664042
Copy link

qq664042 commented Aug 1, 2024

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

2.7.22

Steps to reproduce this issue

springboot项目集成dubbo 2.7.22, dubbo.xml有dubbo:reference引用,类似于 <dubbo:reference interface="com.xdd.test.demo44.remote.IUserServiceRemote" id="userServiceRemote"/>
启动springboot后,然后观查java.lang.ApplicationShutdownHooks.hooks变量,会多出一个DubboShutdownHook对象

What you expected to happen

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean先执行了DubboShutdownHook.getDubboShutdownHook().unregister()

给bean的属性赋值时org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean 再执行DubboShutdownHook.getDubboShutdownHook().register()

顺序搞反了,导致consumer启动后一直会有DubboShutdownHook这个勾子,在consumer停止的时候,DubboShutdownHook可能会优先于SpringApplicationShutdownHook执行,把没有执行完的任务直接关闭,出现Interrupted unexpectedly while waiting for异常
image

Anything else

好像也看到类似的问题,不过不是这个版本https://github.com/apache/dubbo/issues/7093。

dubbo2.7.3是没有这个bug的。

我现在的解决方法是在springboot启动后,直接调用DubboShutdownHook.getDubboShutdownHook().unregister();

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

@qq664042 qq664042 added component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage labels Aug 1, 2024
@wcy666103
Copy link
Contributor

Please re-submit this pr in english only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage
Projects
Archived in project
Development

No branches or pull requests

3 participants