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

[增加新特性]改进dubbo的shutdown处理过程 #7728

Closed
2 tasks done
klzami opened this issue May 11, 2021 · 4 comments
Closed
2 tasks done

[增加新特性]改进dubbo的shutdown处理过程 #7728

klzami opened this issue May 11, 2021 · 4 comments
Labels
type/bug Bugs to being fixed

Comments

@klzami
Copy link
Contributor

klzami commented May 11, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 所有版本
  • Operating System version: 所有系统
  • Java version: 所有版本

Steps to reproduce this issue

以下是dubbo注册shutdown钩子相关的类,可以看到:dubbo的shutdown直接挂在了JVM的shutdown钩子上。

  1. org.apache.dubbo.config.bootstrap.DubboBootstrap#DubboBootstrap
  2. org.apache.dubbo.config.DubboShutdownHook#register

这种设计导致1个问题:

不能够控制组件的shutdown次序,我希望job组件首先shutdown,dubbo组件随后shutdown,但却做不到。
因为jvm的shutdown钩子是无序的,而spring的shutdown钩子则可以定义执行的先后顺序。

Expected Result

  1. 如果dubbo单独运行,没有spring环境,则dubbo shutdown直接挂在JVM的shutdown钩子上(维持现状);
  2. 如果dubbo运行在spring环境下,则关联spring的shutdown钩子,以便控制shutdown的执行顺序(新增特性)。

Actual Result

dubbo当前只支持关联到jvm的shutdown钩子,而不支持关联到spring的shutdown钩子。

@xiaoheng1
Copy link
Contributor

Related to #7093.

@pinxiong
Copy link
Member

@klzami Can this issue be closed? If necessary, we can open it again.

@AlbumenJ
Copy link
Member

fix in #7317

@AlbumenJ AlbumenJ added related/spring type/bug Bugs to being fixed labels May 16, 2021
@leimbag
Copy link

leimbag commented Apr 7, 2022

dubbo 3.0.5 版本该问题并没有解决,DubboBeanUtils的registerCommonBeans方法里面的DubboBootstrapApplicationListener也没有注册。所以在dubbo运行在spring环境下,如何关联spring的shutdown的钩子以及控制顺序?有大佬说明一下吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Bugs to being fixed
Projects
None yet
Development

No branches or pull requests

5 participants