Skip to content
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

motan client没有使用shutdownhook #64

Closed
valleylord opened this issue May 16, 2016 · 2 comments
Closed

motan client没有使用shutdownhook #64

valleylord opened this issue May 16, 2016 · 2 comments

Comments

@valleylord
Copy link

valleylord commented May 16, 2016

版本0.1.0,motan client本身似乎没有使用shutdownhook,在强制关闭client的时候,server会报异常,如下,

09:35:05.232 ERROR [New I/O server worker #1-2] error NettyChannelHandler exceptionCaught: remote=arnes-PC/192.168.232.154:56910 local=/192.168.232.154:38001 event=java.io.IOException: 远程主机强迫关闭了一个现有的连接。
java.io.IOException: 远程主机强迫关闭了一个现有的连接。
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:192)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:321)
at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:280)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:200)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

motan是否有预期增加shutdownhook?或者,我可以如何添加?

@qdaxb
Copy link
Collaborator

qdaxb commented May 17, 2016

在我们的使用场景中,client的关闭时会由调度系统从线上摘除,之后再关闭。如果强制关闭client的话shutdownhook的意义似乎也不大,可以详细描述一下你的应用场景吗?

@valleylord
Copy link
Author

ok,原来是用优雅关闭的方式来shutdown,这样的话看起来也不是太大的问题。

@qdaxb qdaxb closed this as completed Jun 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants