优雅停机与Spring boot配合使用的问题
https://cn.dubbo.apache.org/zh-cn/overview/mannual/java-sdk/advanced-features-and-usage/others/graceful-shutdown/ 这个页面中注意事项第4条这么说的:
如果使用了 SpringBoot,Dubbo 的 ShutdownHook 会在 SpringBoot 的 ShutdownHook 之前执行
我用的是spring boot3.x,也配置了Spring boot 的server: shutdown: graceful. 但是还会有个问题,就是用kill PID(其实是docker stop)的方式终止的时候dubbo先关闭服务,但是spring 还有请求过来,spring的controller中有调用其他dubbo服务,这时候dubbo服务已经关闭了,调用其他服务就会出现如下错误
java.util.concurrent.ExecutionException: org.apache.dubbo.rpc.RpcException: Directory of type RegistryDirectory already destroyed for service com.xxx.user.rpc.UserRpc from registry nacos://192.168.100.240:8848/org.apache.dubbo.registry.RegistryService?application=xxx-service&dubbo=2.0.2&environment=product&executor-management-mode=isolation&file-cache=true&logger=slf4j&organization=xx&owner=xxx&pid=1&qos.enable=true&qos.port=28029®ister-mode=instance&release=3.2.0&serialize.check.status=WARN&shutwait=5000×tamp=1689590386952
请问正常是会有这个问题吗还是哪里配置的问题
详细看了看停止服务时候的日志有这么两段日志
[DUBBO] Waiting for modules(Dubbo Application[1.1](user-service)) managed by Spring to be shutdown., dubbo version: 3.2.2, current host: 172.18.0.1
[DUBBO] Dubbo wait for application(Dubbo Application[1.1](user-service)) managed by Spring to be shutdown failed, time usage: 11ms, dubbo version: 3.2.2, current host: 172.18.0.1
Try it with version 3.2.4, this should be fixed
Try it with version 3.2.4, this should be fixed
i try with both 3.2.4 and 3.2.5-SNAPSHOT, the two versions do not work too.
Try it with version 3.2.4, this should be fixed
i try with both 3.2.4 and 3.2.5-SNAPSHOT, the two versions do not work too.
What is the logs of managed by Spring to be shutdown failed, time usage?
3.2.9 问题依旧
dubbo 的优雅停机貌似是个半成品?实际线上有直接用它的吗,是不是都需要自己实现一套?