dubbo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] beiwei30 closed pull request #1722: enhance comments, javadoc and logging message for ExecutionChannelHandler
Date Wed, 02 May 2018 06:26:40 GMT
beiwei30 closed pull request #1722: enhance comments, javadoc and logging message for ExecutionChannelHandler
URL: https://github.com/apache/incubator-dubbo/pull/1722
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 91b5804317..8a19bdd5a3 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
@@ -29,6 +29,10 @@
 
 import java.util.concurrent.RejectedExecutionException;
 
+/**
+ * Only request message will be dispatched to thread pool. Other messages like response,
connect, disconnect,
+ * heartbeat will be directly executed by I/O thread.
+ */
 public class ExecutionChannelHandler extends WrappedChannelHandler {
 
     public ExecutionChannelHandler(ChannelHandler handler, URL url) {
@@ -41,13 +45,14 @@ 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
+                // FIXME: when the thread pool is full, SERVER_THREADPOOL_EXHAUSTED_ERROR
cannot return properly,
+                // therefore the consumer side has to wait until gets timeout. This is a
temporary solution to prevent
+                // this scenario from happening, but a better solution should be considered
later.
                 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();
+                                + ") thread pool is exhausted, detail msg:" + t.getMessage();
                         Response response = new Response(request.getId(), request.getVersion());
                         response.setStatus(Response.SERVER_THREADPOOL_EXHAUSTED_ERROR);
                         response.setErrorMessage(msg);
@@ -55,7 +60,7 @@ public void received(Channel channel, Object message) throws RemotingException
{
                         return;
                     }
                 }
-                throw new ExecutionException(message, channel, getClass() + " error when
process received event .", t);
+                throw new ExecutionException(message, channel, getClass() + " error when
process received event.", t);
             }
         } else {
             handler.received(channel, message);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Mime
View raw message