Comments (11)
工作流程上要求自动部署,现在引入dubbo后,tomcat重新部署某个应用就hang在那边了,流程走不下去。Dubbox发现provider可以正常关闭,但是consumer死活无法关闭,究其原因是NettyClient里面ShutdownHook没有执行到。我们用了一个比较hack的方法,通过反射来调用NettyClient#channelFactory.releaseExternalResources()
try {
final Class<?> clazz = Class.forName("com.alibaba.dubbo.remoting.transport.netty.NettyClient");
Field field = clazz.getDeclaredField("channelFactory");
field.setAccessible(true);
Object channelFactory = field.get(null);
Method method = channelFactory.getClass().getMethod("releaseExternalResources");
method.invoke(channelFactory);
} catch (Exception e){
e.printStackTrace();
}
from dubbox.
kill -9 大家都这么追求完美吗?
from dubbox.
关不掉可以试试用最新snapshot。如果是强行关机,threadlocal没有释放也没什么,正常调用应该有释放程序
from dubbox.
关不掉可以试试用最新snapshot。如果是强行关机,threadlocal没有释放也没什么,正常调用应该有释放程序
from dubbox.
@XiaochunLU
直接release,channelFactory.如果有正在进行的任务,会有怎样的结果?
from dubbox.
我们在linux服务器上做并发测试时也发现了这个问题,总是有n个消费端和服务端的进程无法关闭,导致下次启动失败
我们在配置了客户端init=true(启动容器时初始化消费端)以后没这个问题了,你们也可以试试
from dubbox.
我也遇到了你这个问题。我跟踪了下,消费端一直没有在ZooKeeper注册中心注销。你看下你的ZooKeeper版本是不是3.3.3。你把ZooKeeper版本换成3.4.5试一试。zkclient0.1间接依赖的ZooKeeper版本是3.3.3。
from dubbox.
public class WebContextListener implements ApplicationListener {
private static final Logger logger = LoggerFactory.getLogger(WebContextListener.class);
@Override
public void onApplicationEvent(ApplicationEvent applicationEvent) {
if (applicationEvent instanceof ContextStartedEvent){
logger.debug("It was Started.");
}
if (applicationEvent instanceof ContextClosedEvent){
ContextClosedEvent event = (ContextClosedEvent) applicationEvent;
if(event.getApplicationContext().getParent()==null){
logger.debug("App context was Closed.");
synchronized (Main.class) {
try {
Main.class.notifyAll();
} catch (Throwable e) {}
}
Runtime.getRuntime().exit(0);
}else{
logger.debug("Web context was Closed.");
}
event = null;
}
}
}
from dubbox.
用一个监听ContextClosed 方法来关闭
from dubbox.
我也遇到这个问题了,查了jstack发现除了主线程之外还有一个非daemon线程。
"Hashed wheel timer #1@4029" prio=5 tid=0x32 nid=NA sleeping
java.lang.Thread.State: TIMED_WAITING
at java.lang.Thread.sleep(Thread.java:-1)
at org.jboss.netty.util.HashedWheelTimer$Worker.waitForNextTick(HashedWheelTimer.java:503)
at org.jboss.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:401)
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at java.lang.Thread.run(Thread.java:745)
我现在尝试去解决一下这个问题。待会把解决方法po出来
from dubbox.
刚才发现这个Hashed wheel timer使用的是Executors.DefaultThreadFactory.newThread创建的,所以是non-daemon。所以导致了tomcat主进程无法终止。#117
from dubbox.
Related Issues (20)
- 我用最新的dubbo-spring-boot提供服务,消费端用dubbo2.8.4消费,报invok。。。的错误
- 请问dubbo-monitor-simple-2.8.3是你们的版本吗 HOT 1
- dubbox2.8.4 为啥不能打包成功 HOT 5
- springboot整合dubbox类型转换异常
- 从dubbox 2.8.4转移到阿里重新维护的dubbo2.5.* 是否可以? HOT 6
- dubbox如何设置servlet静态资源
- 请变更groupId
- 2.8.4接入腾讯TSF出现类型错误的情况。
- Dubbox不支持DubboComponentScan
- Please check if the providers have been started and registered.
- 是否支持protobuf序列化
- 2.8.4优雅停机 HOT 4
- dubbox 2.8.4版本作为消费者调用2.6.3及之后的版本报Unknown result flag, expect '0' '1' '2', get 4 HOT 2
- 111
- 应用停止过程rest请求报错
- CVE-2019-17564在dubbox中是否存在
- CVE-2020-1948在dubbox中是否存在
- dubbox中<dubbo:service document="这个document属性是做什么的"> HOT 1
- dubbox中<dubbo:reference check=false> 设置消费者check=false没有生效
- dubbo测试callback报错
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dubbox.