yugj commented on issue #8172:
URL: https://github.com/apache/dubbo/issues/8172#issuecomment-872711352


   > > 临时通过重写ExecutorRepository重新创建线程池兼容了下
   > 
   > 不太建议在DefaultExecutorRepository.getExecutor中再去createExecutorIfAbsent。
   > 
消费者端线程池首次创建时,在org.apache.dubbo.remoting.transport.AbstractClient#initExecutor会设置url中threadpool=cached。
   > 
而运行期间DefaultExecutorRepository.getExecutor时候会造成创建默认fixed线程池(因为ThreadPool的SPI注解里默认类型@SPI(FixedThreadPool.NAME)),而不是期望的cached类型消费者端线程池。
   > 
   > 
所以我倾向于在org.apache.dubbo.remoting.exchange.support.DefaultFuture#closeChannel中去掉下面部分地吗
   > 
   > ```
   > -                    ExecutorService futureExecutor = future.getExecutor();
   > -                    if (futureExecutor != null && 
!futureExecutor.isTerminated()) {
   > -                        futureExecutor.shutdownNow();
   > -                    }
   > ```
   > 
   > 甚至,也可以在DefaultExecutorRepository中对兜底的SHARED_EXECUTOR做个保护。
   
   
是的,需要一起修改下dubbo.consumer.threadpool=cached,全局线程池情况下,确实不应该关闭,能去除这边关闭最好,但是DefaultFuture貌似没有提供直接扩展方式
   


-- 
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