alibaba / spring-cloud-alibaba

Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
https://sca.aliyun.com
Apache License 2.0
27.83k stars 8.32k forks source link

nacos 里修改配制后, 触发了 shutdown #1285

Closed KeRan213539 closed 3 years ago

KeRan213539 commented 4 years ago

SCA版本; 2.1.1.RELEASE dubbo版本: 2.7.4.1 nacos版本: 1.1.4 spring boot版本: 2.1.7.RELEASE dubbo 提供者项目,部分配制在nacos中, 没有引入 spring-boot-starter-web 的包, 并以非web方式启动

new SpringApplicationBuilder(xxx.class)
                // 非 Web 应用
                .web(WebApplicationType.NONE)
                .run(args);

修改了nacos 里的配制后,触发了 shutdown, 下面是部分日志

[log]-2020-03-25 18:28:26.505 [com.alibaba.nacos.client.Worker.longPolling.fixed-127.0.0.1_8848-yd-payCenter] INFO  org.apache.dubbo.spring.boot.context.event.OverrideDubboConfigApplicationListener - Dubbo Config was overridden by externalized configuration {dubbo.application.name=service, dubbo.application.qos-enable=false, dubbo.config.multiple=true}
[log]-2020-03-25 18:28:28.721 [com.alibaba.nacos.client.Worker.longPolling.fixed-127.0.0.1_8848-yd-payCenter] INFO  org.apache.dubbo.spring.boot.context.event.AwaitingNonWebApplicationListener -  [Dubbo] Current Spring Boot Application is about to shutdown...
[log]-2020-03-25 18:28:28.723 [Thread-43] INFO  org.apache.dubbo.registry.support.AbstractRegistryFactory -  [DUBBO] Close all registries [nacos://127.0.0.1:8848/org.apache.dubbo.registry.RegistryService?application=service&dubbo=2.0.2&interface=org.apache.dubbo.registry.RegistryService&pid=18644&qos.enable=false&qos.port=22222&release=2.7.4.1&timestamp=1585132069474], dubbo version: 2.7.4.1, current host: 192.168.1.88
KeRan213539 commented 4 years ago

临时解决方案:

但是这样搞启动后第一次修改的时候还是会触发 shutdown(shutdown日志还是输出了), 不过并没有真正 shutdown, 提供者也能正常调用. 第二次~第N次修改就不会触发shutdown 了.