nulinuli-nuli commented on issue #7054:
URL: https://github.com/apache/dubbo/issues/7054#issuecomment-3573661952

   @zhangyz-hd  
在某个provider突然OOM下线之后,consumer消费端会将对应端口对应的线程池关闭,这是是不可能会导致内存泄露啊。因为我看那个异步任务的超时检测通知也是由这个线程池来执行的。
   
       private static class TimeoutCheckTask implements TimerTask {
   
           private final Long requestID;
   
           TimeoutCheckTask(Long requestID) {
               this.requestID = requestID;
           }
   
           @Override
           public void run(Timeout timeout) {
               DefaultFuture future = DefaultFuture.getFuture(requestID);
               if (future == null || future.isDone()) {
                   return;
               }
   
               if (future.getExecutor() != null) {
                   future.getExecutor().execute(() -> notifyTimeout(future));
               } else {
                   notifyTimeout(future);
               }
           }
   
           private void notifyTimeout(DefaultFuture future) {
               // create exception response.
               Response timeoutResponse = new Response(future.getId());
               // set timeout status.
               timeoutResponse.setStatus(future.isSent() ? 
Response.SERVER_TIMEOUT : Response.CLIENT_TIMEOUT);
               timeoutResponse.setErrorMessage(future.getTimeoutMessage(true));
               // handle response.
               DefaultFuture.received(future.getChannel(), timeoutResponse, 
true);
           }
       }


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to