SpringCloud商业版2.9.1.RELEASE,微服务进程自动挂掉

Blade 已结 3 1724
bfwking
bfwking 2022-05-10 08:47

一、该问题的重现步骤是什么?

1. 每隔一段时间,自建的微服务进程会自动挂掉,大多发生在凌晨。


二、你期待的结果是什么?实际看到的又是什么?


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

SpringCloud商业版2.9.1.RELEASE,Ubuntu 20.04.4 LTS

四、请提供详细的错误堆栈信息,这很重要。

2022-05-10 00:13:03.009  INFO 1303944 --- [      Thread-25] c.n.l.PollingServerListUpdater           : Shutting down the Executor Pool for PollingServerListUpdater

2022-05-10 00:13:03.014  INFO 1303944 --- [extShutdownHook] org.quartz.core.QuartzScheduler          : Scheduler quartzScheduler_$_NON_CLUSTERED paused.

2022-05-10 00:13:03.016  INFO 1303944 --- [extShutdownHook] io.undertow                              : stopping server: Undertow - 2.1.7.Final

2022-05-10 00:13:03.025  INFO 1303944 --- [extShutdownHook] io.undertow.servlet                      : Destroying Spring FrameworkServlet 'dispatcherServlet'

2022-05-10 00:13:03.026  INFO 1303944 --- [extShutdownHook] o.s.s.c.ThreadPoolTaskScheduler          : Shutting down ExecutorService 'Nacos-Watch-Task-Scheduler'

2022-05-10 00:13:03.027 ERROR 1303944 --- [extShutdownHook] c.a.cloud.nacos.discovery.NacosWatch     : namingService unsubscribe failed, properties:NacosDiscoveryProperties{serverAddr='192.168.0.116:8848', endpoint='', namespace='', watchDelay=30000, logName='', service='subway-maintenance-core', weight=1.0, clusterName='DEFAULT', group='DEFAULT_GROUP', namingLoadCacheAtStart='false', metadata={preserved.register.source=SPRING_CLOUD}, registerEnabled=true, ip='192.168.0.207', networkInterface='', port=1106, secure=false, accessKey='', secretKey='', heartBeatInterval=null, heartBeatTimeout=null, ipDeleteTimeout=null, failFast=true}


java.lang.IllegalStateException: UT015023: This Context has been already destroyed

        at io.undertow.servlet.spec.ServletContextImpl.getDeploymentInfo(ServletContextImpl.java:211)

        at io.undertow.servlet.spec.ServletContextImpl.getInitParameterNames(ServletContextImpl.java:438)

        at org.springframework.web.context.support.ServletContextPropertySource.getPropertyNames(ServletContextPropertySource.java:41)

        at com.alibaba.spring.util.PropertySourcesUtils.getPropertyNames(PropertySourcesUtils.java:130)

        at com.alibaba.spring.util.PropertySourcesUtils.getSubProperties(PropertySourcesUtils.java:103)

        at com.alibaba.spring.util.PropertySourcesUtils.getSubProperties(PropertySourcesUtils.java:57)

        at com.alibaba.cloud.nacos.NacosDiscoveryProperties.enrichNacosDiscoveryProperties(NacosDiscoveryProperties.java:631)

        at com.alibaba.cloud.nacos.NacosDiscoveryProperties.getNacosProperties(NacosDiscoveryProperties.java:625)

        at com.alibaba.cloud.nacos.discovery.NacosWatch.stop(NacosWatch.java:176)

        at com.alibaba.cloud.nacos.discovery.NacosWatch.stop(NacosWatch.java:108)

        at org.springframework.context.support.DefaultLifecycleProcessor.doStop(DefaultLifecycleProcessor.java:238)

        at org.springframework.context.support.DefaultLifecycleProcessor.access$300(DefaultLifecycleProcessor.java:53)

        at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.stop(DefaultLifecycleProcessor.java:377)

        at org.springframework.context.support.DefaultLifecycleProcessor.stopBeans(DefaultLifecycleProcessor.java:210)

        at org.springframework.context.support.DefaultLifecycleProcessor.onClose(DefaultLifecycleProcessor.java:128)

        at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1022)

        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.doClose(ServletWebServerApplicationContext.java:170)

        at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:949)


2022-05-10 00:13:03.028  INFO 1303944 --- [extShutdownHook] o.s.s.c.ThreadPoolTaskScheduler          : Shutting down ExecutorService 'taskScheduler'

2022-05-10 00:13:03.028  INFO 1303944 --- [extShutdownHook] o.s.s.quartz.SchedulerFactoryBean        : Shutting down Quartz Scheduler

2022-05-10 00:13:03.028  INFO 1303944 --- [extShutdownHook] org.quartz.core.QuartzScheduler          : Scheduler quartzScheduler_$_NON_CLUSTERED shutting down.

2022-05-10 00:13:03.028  INFO 1303944 --- [extShutdownHook] org.quartz.core.QuartzScheduler          : Scheduler quartzScheduler_$_NON_CLUSTERED paused.

2022-05-10 00:13:03.029  INFO 1303944 --- [extShutdownHook] org.quartz.core.QuartzScheduler          : Scheduler quartzScheduler_$_NON_CLUSTERED shutdown complete.

2022-05-10 00:13:03.029  INFO 1303944 --- [extShutdownHook] c.a.c.n.registry.NacosServiceRegistry    : De-registering from Nacos Server now...

2022-05-10 00:13:03.030  WARN 1303944 --- [extShutdownHook] .s.c.a.CommonAnnotationBeanPostProcessor : Destroy method on bean with name 'nacosAutoServiceRegistration' threw an exception: java.lang.IllegalStateException: UT015023: This Context has been already destroyed

2022-05-10 00:13:03.030  INFO 1303944 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'

2022-05-10 00:13:03.510  INFO 1303944 --- [extShutdownHook] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closing ...

2022-05-10 00:13:03.515  INFO 1303944 --- [extShutdownHook] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closed

五、若有更多详细信息,请在下面提供。

3条回答
  •  yinyuncan
    yinyuncan (楼主)
    2022-05-10 14:52

    首先这个错误不是nacos的问题


    因为

    日志中的NacosWatch类实现了SmartLifecycle接口

    所以

    nacos被通知到容器已经关闭,所以在执行nacos停止逻辑时,才抛出来的异常


    至于spring容器为啥被关闭,这个大概率原因就是被系统杀死了(当然人为也可以调用关闭spring容器)


    所以程序在被关闭时需要监控系统内存。cpu,linux交换空间等系统参数

提交回复