Jalyn-X opened a new issue, #13502: URL: https://github.com/apache/dubbo/issues/13502
<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy --> - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate. ## Ask your question here ### 环境 Dubbo: 3.2.3 SpringBoot: 2.3 Java: 1.8 升级到从 `2.7` 升级到 `3.2.3` 发现系统在优雅停机时出现了问题 从日志中看出是绑定到 `Spring` 容器的 `Module` 销毁 (ContextCloseEvent)早于 `webServerGracefulShutdown`(SmartLifeCycle) 导致在进行停机时,还是会有一些请求在 `ModelModule` 销毁后,`Tomcat` 优雅关闭前进来。 [#10919](https://github.com/apache/dubbo/issues/10919#issue-1445099332) 中提出的第二个问题,[#10730](https://github.com/apache/dubbo/pull/10730) 在我本地测试中发现并未得到解决。 为解决这个问题,只能再重新实现 `ContextCloseEvent` ,`Order` 在 `DubboDeployApplicationLitener` 之前,将 `Tomcat` 流量先行摘除。 请问这里会不会考虑将 `ModelModule` 的销毁放在 `LifeCycle` 阶段且在 `webServerGracefulShutdown` 后面。 ### 测试日志 ```log 2023-12-14 14:40:45.223 [] [DubboShutdownHook] INFO org.apache.dubbo.config.DubboShutdownHook - [DUBBO] Run shutdown hook now., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.223 [] [DubboShutdownHook] INFO org.apache.dubbo.config.DubboShutdownHook - [DUBBO] Waiting for modules(Dubbo Application[1.1](demo-dubbo-consumer)) managed by Spring to be shutdown., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.224 [] [SpringContextShutdownHook] INFO org.apache.dubbo.config.deploy.DefaultModuleDeployer - [DUBBO] Dubbo Module[1.1.1] is stopping., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.234 [] [DubboShutdownHook] INFO org.apache.dubbo.config.DubboShutdownHook - [DUBBO] Dubbo wait for application(Dubbo Application[1.1](demo-dubbo-consumer)) managed by Spring to be shutdown failed, time usage: 10ms, dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.234 [] [DubboShutdownHook] INFO org.apache.dubbo.config.DubboShutdownHook - [DUBBO] Dubbo shutdown hooks execute now. Dubbo Application[1.1](demo-dubbo-consumer), dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.258 [] [SpringContextShutdownHook] INFO org.apache.dubbo.registry.client.event.listener.ServiceInstancesChangedListener - [DUBBO] Destroying instance listener of [demo-dubbo-provider], dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.258 [] [SpringContextShutdownHook] INFO org.apache.dubbo.remoting.transport.netty4.NettyChannel - [DUBBO] Close netty channel [id: 0xff3b1ad8, L:/10.35.178.163:57083 - R:/10.35.178.163:20880], dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.259 [] [NettyClientWorker-3-1] INFO org.apache.dubbo.remoting.transport.netty4.NettyClientHandler - [DUBBO] The connection of /10.35.178.163:57083 -> /10.35.178.163:20880 is disconnected., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.259 [] [SpringContextShutdownHook] INFO org.apache.dubbo.remoting.transport.netty4.NettyChannel - [DUBBO] Close netty channel [id: 0x179f59f4, L:/10.35.178.163:57081 - R:/10.35.178.163:20051], dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.261 [] [SpringContextShutdownHook] INFO org.apache.dubbo.config.deploy.DefaultModuleDeployer - [DUBBO] Dubbo Module[1.1.1] has stopped., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.261 [] [SpringContextShutdownHook] INFO org.apache.dubbo.rpc.model.FrameworkModel - [DUBBO] Reset global default application from Dubbo Application[1.1](demo-dubbo-consumer) to null, dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.261 [] [SpringContextShutdownHook] INFO org.apache.dubbo.config.deploy.DefaultApplicationDeployer - [DUBBO] Dubbo Application[1.1](demo-dubbo-consumer) is stopping., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.262 [] [SpringContextShutdownHook] INFO org.apache.dubbo.qos.server.Server - [DUBBO] qos-server stopped., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.262 [] [SpringContextShutdownHook] INFO org.apache.dubbo.qos.server.Server - [DUBBO] qos-server stopped., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.262 [] [SpringContextShutdownHook] INFO org.apache.dubbo.rpc.protocol.tri.TripleProtocol - [DUBBO] Destroying protocol [TripleProtocol] ..., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.262 [] [SpringContextShutdownHook] INFO org.apache.dubbo.qos.server.Server - [DUBBO] qos-server stopped., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.262 [] [SpringContextShutdownHook] INFO org.apache.dubbo.config.deploy.DefaultModuleDeployer - [DUBBO] Dubbo Module[1.1.0] is stopping., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.262 [] [SpringContextShutdownHook] INFO org.apache.dubbo.config.deploy.DefaultModuleDeployer - [DUBBO] Dubbo Module[1.1.0] has stopped., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.262 [] [SpringContextShutdownHook] INFO org.apache.dubbo.registry.support.RegistryManager - [DUBBO] Close all registries [nacos://infosys-katherynetest.unis.com:8848/org.apache.dubbo.registry.RegistryService?REGISTRY_CLUSTER=default&application=demo-dubbo-consumer&dubbo=2.0.2&executor-management-mode=isolation&file-cache=true&interface=org.apache.dubbo.registry.RegistryService&namespace=977811bc-c28e-47d6-a7ee-00732eddaca5&password=* nacos://infosys-katherynetest.unis.com:8848/org.apache.dubbo.registry.RegistryService?REGISTRY_CLUSTER=default&application=demo-dubbo-consumer&dubbo=2.0.2&executor-management-mode=isolation&file-cache=true&interface=org.apache.dubbo.registry.RegistryService&namespace=977811bc-c28e-47d6-a7ee-00732eddaca5&password=* dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.262 [] [NettyClientWorker-2-1] INFO org.apache.dubbo.remoting.transport.netty4.NettyConnectionHandler - [DUBBO] The client has been closed and will not reconnect. , dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.267 [] [SpringContextShutdownHook] INFO org.apache.dubbo.common.threadpool.manager.DefaultExecutorRepository - [DUBBO] destroying application executor repository .., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.267 [] [SpringContextShutdownHook] INFO org.apache.dubbo.config.deploy.DefaultApplicationDeployer - [DUBBO] Dubbo Application[1.1](demo-dubbo-consumer) has stopped., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.268 [] [SpringContextShutdownHook] INFO org.apache.dubbo.rpc.model.FrameworkModel - [DUBBO] Destroying default framework model: Dubbo Framework[1], dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.268 [] [SpringContextShutdownHook] INFO org.apache.dubbo.rpc.model.FrameworkModel - [DUBBO] Dubbo Framework[1] is destroying ..., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.268 [] [SpringContextShutdownHook] INFO org.apache.dubbo.config.deploy.DefaultApplicationDeployer - [DUBBO] Dubbo Application[1.0](DUBBO_INTERNAL_APPLICATION) is stopping., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.268 [] [SpringContextShutdownHook] INFO org.apache.dubbo.config.deploy.DefaultModuleDeployer - [DUBBO] Dubbo Module[1.0.0] is stopping., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.268 [] [SpringContextShutdownHook] INFO org.apache.dubbo.config.deploy.DefaultModuleDeployer - [DUBBO] Dubbo Module[1.0.0] has stopped., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.268 [] [SpringContextShutdownHook] INFO org.apache.dubbo.registry.support.RegistryManager - [DUBBO] Close all registries [], dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.268 [] [SpringContextShutdownHook] INFO org.apache.dubbo.common.threadpool.manager.DefaultExecutorRepository - [DUBBO] destroying application executor repository .., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.268 [] [SpringContextShutdownHook] INFO org.apache.dubbo.config.deploy.DefaultApplicationDeployer - [DUBBO] Dubbo Application[1.0](DUBBO_INTERNAL_APPLICATION) has stopped., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.268 [] [SpringContextShutdownHook] INFO org.apache.dubbo.rpc.model.FrameworkModel - [DUBBO] Dubbo Framework[1] is destroyed, dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.268 [] [SpringContextShutdownHook] INFO org.apache.dubbo.rpc.model.FrameworkModel - [DUBBO] Reset global default framework from Dubbo Framework[1] to null, dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.268 [] [SpringContextShutdownHook] INFO org.apache.dubbo.common.resource.GlobalResourcesRepository - [DUBBO] Destroying global resources ..., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.271 [] [SpringContextShutdownHook] INFO org.apache.dubbo.common.resource.GlobalResourcesRepository - [DUBBO] Dubbo is completely destroyed, dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.271 [] [SpringContextShutdownHook] INFO org.apache.dubbo.common.threadpool.manager.FrameworkExecutorRepository - [DUBBO] destroying framework executor repository .., dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.272 [] [SpringContextShutdownHook] INFO org.apache.dubbo.config.spring.context.DubboSpringInitializer - [DUBBO] Unbind Dubbo Module[1.1.1] from spring container: org.springframework.beans.factory.support.DefaultListableBeanFactory@467b0f6e, dubbo version: 3.2.3, current host: 10.35.178.163 2023-12-14 14:40:45.272 [] [SpringContextShutdownHook] DEBUG org.springframework.context.support.DefaultLifecycleProcessor -Stopping beans in phase 2147483647 2023-12-14 14:40:45.273 [] [SpringContextShutdownHook] DEBUG org.springframework.context.support.DefaultLifecycleProcessor -Bean 'webServerGracefulShutdown' completed its stop procedure 2023-12-14 14:40:45.273 [] [SpringContextShutdownHook] DEBUG org.springframework.context.support.DefaultLifecycleProcessor -Stopping beans in phase 2147483646 2023-12-14 14:40:45.286 [] [SpringContextShutdownHook] DEBUG org.springframework.context.support.DefaultLifecycleProcessor -Bean 'webServerStartStop' completed its stop procedure 2023-12-14 14:40:45.287 [] [SpringContextShutdownHook] DEBUG org.springframework.context.support.DefaultLifecycleProcessor -Stopping beans in phase 2147483647 2023-12-14 14:40:45.287 [] [SpringContextShutdownHook] DEBUG org.springframework.context.support.DefaultLifecycleProcessor -Bean 'webServerGracefulShutdown' completed its stop procedure 2023-12-14 14:40:45.287 [] [SpringContextShutdownHook] DEBUG org.springframework.context.support.DefaultLifecycleProcessor -Stopping beans in phase 2147483646 2023-12-14 14:40:45.294 [] [SpringContextShutdownHook] DEBUG org.springframework.context.support.DefaultLifecycleProcessor -Bean 'webServerStartStop' completed its stop procedure 2023-12-14 14:40:45.295 [] [SpringContextShutdownHook] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor -Shutting down ExecutorService 'applicationTaskExecutor' ``` -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
