-
Notifications
You must be signed in to change notification settings - Fork 26.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dubbo作为消费者在tomcat中,关闭tomcat时ERROR日志 #59
Comments
我也是这种情况 。求解答 |
在没使用dubbo的应用里也会有这个错误,dubbo的相关错误我理解是,tomcat已经在做class的卸载,但dubbo还在向注册中心发送注销请求,所以报错了。 |
我也遇到相同的问题'求解答 |
第一堆异常 是软件包没有优雅释放资源导致的,不影响,很多包都有这样的问题,odbc驱动包也会这样, 第二堆异常是销毁顺序问题,采用shutdownhook去销毁不能保证正确的销毁顺序,我们这边目前的做法是停机前主动先去销毁dubbo的, DubboShutdownHook应该主要是提供在standalone方式运行dubbo的时候,去实现优雅停机的,但是如果是使用外部容器的方式DubboShutdownHook就不合适了,销毁应该交给容器的停止的监听去触发,否则就会出现这种顺序不对导致的问题 |
@wuwen5 HI,朋友。第二堆异常的需要做哪些修改,能提供下具体代码吗? 如果在容器中运行dubbo,是否要禁用dubbo的DubboShutdownHook |
等待着高手解答 |
对问题2,我发现在spring的war使用
} |
@yungoo 这种在关闭tomcat时候,可以让dubbo优雅停机吗 |
Related issue #1665 |
@ralf0131 今晚我们在生产环境也遇到了作者说的第二个异常 问题描述Dubbo应用在关闭时报 2018-05-10 20:30:10,597 WARN [DubboShutdownHook] c.a.d.r.z.ZookeeperRegistry - [] [] [] [DUBBO] Failed to unregister url consumer://xxx.xxx.xxx.xxx/com.wacai.ucenter.service.NicknameValidatable?application=ucenter-query&category=consumers&check=false&default.check=false&default.retries=0&default.timeout=5000&dubbo=3.1.1&init=true&interface=com.wacai.ucenter.service.NicknameValidatable&methods=queryAudit,moveNicknameCache,validateAndUid,validateAndType,validate&owner=xxx&pid=27285&revision=1.7.0&side=consumer×tamp=1525801075589 to registry zookeeper://xxx:12181/com.alibaba.dubbo.registry.RegistryService?application=ucenter-query&backup=xxx&client=zkclient&dubbo=3.1.1&group=dubbo_product&interface=com.alibaba.dubbo.registry.RegistryService&owner=xxx&pid=27285×tamp=1525801075625 on destroy, cause: com/alibaba/dubbo/registry/support/SkipFailbackWrapperException, dubbo version: 3.1.1, current host: xxx.xxx.xxx.xxx
java.lang.NoClassDefFoundError: com/alibaba/dubbo/registry/support/SkipFailbackWrapperException
at com.alibaba.dubbo.registry.support.FailbackRegistry.unregister(FailbackRegistry.java:168)
at com.alibaba.dubbo.registry.support.AbstractRegistry.destroy(AbstractRegistry.java:492)
at com.alibaba.dubbo.registry.support.FailbackRegistry.destroy(FailbackRegistry.java:436)
at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.destroy(ZookeeperRegistry.java:90)
at com.alibaba.dubbo.registry.support.AbstractRegistryFactory.destroyAll(AbstractRegistryFactory.java:70)
at com.alibaba.dubbo.config.ProtocolConfig.destroyAll(ProtocolConfig.java:429)
at com.alibaba.dubbo.config.AbstractConfig$1.run(AbstractConfig.java:452)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.alibaba.dubbo.registry.support.SkipFailbackWrapperException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:94)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 8 common frames omitted 问题分析根据异常日志,异常是从 解决方案对 boolean skipFailback = false;
try {
skipFailback = t instanceof SkipFailbackWrapperException;
} catch (Throwable t1) {
logger.error("Failed to unregister " + url + ", waiting for retry, cause: " + t.getMessage(), t);
logger.error("Unregister url occur unexpected error, cause: " + t1.getMessage(), t1);
} |
This is because tomcat has been stopped but some of the threads Dubbo created did not stopped correctly. Previously Dubbo uses ShutdownHook to stop these threads, but when tomcat is stops the web application, Dubbo's ShutdownHook has not been executed yet. The solution is to ensure Dubbo listens to web application's lifecycle and stops the threads properly. This issue should be fixed from 2.6.3 onwards. |
有一个应用部署在tomcat中,使用dubbo作为消费端去调用单独部署的服务者,关闭tomcat的时候打印出一大堆ERROR级别的信息,google上搜索很多人说是tomcat6.24之后的问题,但是看着好闹心呀,信息如下:
还有一些异常的信息:
貌似是关闭tomcat的时候,dubbo没有接到关闭信号导致的,虽然最终tomcat能正常关闭,但是这些日志看的好恶心呀,有遇到这种情况的吗
The text was updated successfully, but these errors were encountered: