You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by il...@apache.org on 2018/04/30 10:01:19 UTC
[incubator-dubbo] branch master updated: fixes #1089,
make ExecutionDispatcher meet dubbo-user-book (#1449)
This is an automated email from the ASF dual-hosted git repository.
iluo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new 080e8ef fixes #1089, make ExecutionDispatcher meet dubbo-user-book (#1449)
080e8ef is described below
commit 080e8ef3dd7e3736a9ed83fdb34127726a614677
Author: qct <qu...@163.com>
AuthorDate: Mon Apr 30 18:01:16 2018 +0800
fixes #1089, make ExecutionDispatcher meet dubbo-user-book (#1449)
* fixes #1089, make ExecutionDispatcher meets dubbo-user-book
* remove heartbeat condition
---
.../execution/ExecutionChannelHandler.java | 56 +++++++++-------------
1 file changed, 22 insertions(+), 34 deletions(-)
diff --git a/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/transport/dispatcher/execution/ExecutionChannelHandler.java b/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/transport/dispatcher/execution/ExecutionChannelHandler.java
index 2cb4634..91b5804 100644
--- a/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/transport/dispatcher/execution/ExecutionChannelHandler.java
+++ b/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/transport/dispatcher/execution/ExecutionChannelHandler.java
@@ -36,41 +36,29 @@ public class ExecutionChannelHandler extends WrappedChannelHandler {
}
@Override
- public void connected(Channel channel) throws RemotingException {
- executor.execute(new ChannelEventRunnable(channel, handler, ChannelState.CONNECTED));
- }
-
- @Override
- public void disconnected(Channel channel) throws RemotingException {
- executor.execute(new ChannelEventRunnable(channel, handler, ChannelState.DISCONNECTED));
- }
-
- @Override
public void received(Channel channel, Object message) throws RemotingException {
- try {
- executor.execute(new ChannelEventRunnable(channel, handler, ChannelState.RECEIVED, message));
- } catch (Throwable t) {
- //TODO A temporary solution to the problem that the exception information can not be sent to the opposite end after the thread pool is full. Need a refactoring
- //fix The thread pool is full, refuses to call, does not return, and causes the consumer to wait for time out
- if(message instanceof Request &&
- t instanceof RejectedExecutionException){
- Request request = (Request)message;
- if(request.isTwoWay()){
- String msg = "Server side("+url.getIp()+","+url.getPort()+") threadpool is exhausted ,detail msg:"+t.getMessage();
- Response response = new Response(request.getId(), request.getVersion());
- response.setStatus(Response.SERVER_THREADPOOL_EXHAUSTED_ERROR);
- response.setErrorMessage(msg);
- channel.send(response);
- return;
- }
- }
- throw new ExecutionException(message, channel, getClass() + " error when process received event .", t);
+ if (message instanceof Request) {
+ try {
+ executor.execute(new ChannelEventRunnable(channel, handler, ChannelState.RECEIVED, message));
+ } catch (Throwable t) {
+ //TODO A temporary solution to the problem that the exception information can not be sent to the opposite end after the thread pool is full. Need a refactoring
+ //fix The thread pool is full, refuses to call, does not return, and causes the consumer to wait for time out
+ if (t instanceof RejectedExecutionException) {
+ Request request = (Request) message;
+ if (request.isTwoWay()) {
+ String msg = "Server side(" + url.getIp() + "," + url.getPort()
+ + ") threadpool is exhausted ,detail msg:" + t.getMessage();
+ Response response = new Response(request.getId(), request.getVersion());
+ response.setStatus(Response.SERVER_THREADPOOL_EXHAUSTED_ERROR);
+ response.setErrorMessage(msg);
+ channel.send(response);
+ return;
+ }
+ }
+ throw new ExecutionException(message, channel, getClass() + " error when process received event .", t);
+ }
+ } else {
+ handler.received(channel, message);
}
}
-
- @Override
- public void caught(Channel channel, Throwable exception) throws RemotingException {
- executor.execute(new ChannelEventRunnable(channel, handler, ChannelState.CAUGHT, exception));
- }
-
}
--
To stop receiving notification emails like this one, please contact
iluo@apache.org.