You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/11/11 08:09:30 UTC

[GitHub] [dubbo] phiss opened a new issue, #10919: dubbo

phiss opened a new issue, #10919:
URL: https://github.com/apache/dubbo/issues/10919

   ## Environment
   Dubbo version: 2.7.18
   Java version: 1.8
   
   ## Ask your question here
   
   关于dubbo对于优雅关闭的支持实现,监听ContextClosedEvent事件后,会调用DubboShutdownHook#run()方法,
   有些许疑问:
   
   - DubboShutdownHook类继承Thread类,直接调用run方法,而不是启动新线程去执行,是基于什么考虑。
   
   - springboot2.3开始支持内嵌web服务器的优雅关闭(基于SmartLifecycle实现),dubbo监听ContextClosedEvent事件去关闭,执行顺序在web服务器优雅关闭之前,如果springboot没有配置异步线程池,ContextClosedEvent的监听方法是同步执行,在该场景下,dubbo会先关闭,然后才是web服务器优雅关闭执行 (如果web服务器优雅关闭先执行,切断新的入口请求,后续再执行dubbo优雅停机,是否会更合理些)。
   
   
   ```
       # DubboBootstrapApplicationListener.class 
       private void onContextClosedEvent(ContextClosedEvent event) {
           DubboShutdownHook.getDubboShutdownHook().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.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] CrazyHZM closed issue #10919: dubbo优雅关闭

Posted by GitBox <gi...@apache.org>.
CrazyHZM closed issue #10919: dubbo优雅关闭
URL: https://github.com/apache/dubbo/issues/10919


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10919: dubbo优雅关闭

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10919:
URL: https://github.com/apache/dubbo/issues/10919#issuecomment-1312402829

   > DubboShutdownHook类继承Thread类,直接调用run方法,而不是启动新线程去执行,是基于什么考虑。
   
   JVM 层面已经调用 `start` 方法了,Dubbo 只需要实现 `run` 就行
   
   > springboot2.3开始支持内嵌web服务器的优雅关闭(基于SmartLifecycle实现),dubbo监听ContextClosedEvent事件去关闭,执行顺序在web服务器优雅关闭之前,如果springboot没有配置异步线程池,ContextClosedEvent的监听方法是同步执行,在该场景下,dubbo会先关闭,然后才是web服务器优雅关闭执行 (如果web服务器优雅关闭先执行,切断新的入口请求,后续再执行dubbo优雅停机,是否会更合理些)。
   
   https://github.com/apache/dubbo/pull/10730 已实现


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org