sadlay opened a new issue, #11524:
URL: https://github.com/apache/dubbo/issues/11524

   <!-- If you need to report a security issue please visit 
https://github.com/apache/dubbo/security/policy -->
   
   - [x] I have searched the [issues](https://github.com/apache/dubbo/issues) 
of this repository and believe that this is not a duplicate.
   
   在通过 dubbo.protocol.threads 配置线程池数量后(包括其他线程池参数),会在某些情况下失效。
   ### Environment
   
   * Dubbo version: 3.1.1
   * Operating System version: MacOS,Linux,Windows全平台
   * Java version: 1.8
   
   ### Steps to reproduce this issue
   
   1. 服务调用链路 **A** -> **B** -> **C**
   
   2. 所有服务配置线程池参数:
   
      dubbo.protocol.threadpool=fixed
      dubbo.protocol.threads=720
      dubbo.protocol.corethreads=720
   
   3. 在服务 **B** 中编写一个Spring Bean,实现 **InitializingBean** 接口,同时在 
**afterPropertiesSet **方法中调用服务 **C** 的接口,用于初始化一些数据
   
   4. 所有应用启动后,服务 **A** 调用服务 **B** 接口,观察服务**B** 的线程池
   
   ### Expected Behavior
   
   服务 **B** 的线程池
   
   - 类型: fixed
   - 数量:720
   - 核心:720
   
   ### Actual Behavior
   
   服务 **B** 的线程池
   
   - 类型: cached
   - 数量:100
   - 核心:2
   
   
   例如在 **Spring Bean** 的生命周期初始化阶段发起 **RPC** 远程调用,也就是 
`ServiceBean#afterPropertiesSet` 之前,由于**configManager** 不存在任何 
**serviceConfig**,在未发布任何 **provider** 情况下,首先触发了 
`DefaultApplicationDeployer#exportMetadataService()` 
方法,导致`org.apache.dubbo.metadata.MetadataService` 元数据接口被第一个 **export** 
,之后走到`DubboProtocol#openServer`方法,此时**serverMap** 为空,所以创建进入 **createServer**方法
   
   <img width="1824" alt="image" 
src="https://user-images.githubusercontent.com/38170721/218169549-202a1f63-b7ae-452f-8781-a2f8bd3ddbe4.png";>
   
   最终将 **MetadataService** 的 **URL** 
注册到`org.apache.dubbo.remoting.transport.AbstractServer#url`中,
   
   <img width="1847" alt="image" 
src="https://user-images.githubusercontent.com/38170721/218167298-c631d74f-dd84-469c-8f84-047c24d078ee.png";>
   
   而在服务启动后,接收请求同时,获取 **ExecutorService** 时,由于是通过URL获取,所以取到 **MetadataService** 
的线程池,而非 **dubbo.protocol.* **配置的线程池
   
   <img width="1871" alt="image" 
src="https://user-images.githubusercontent.com/38170721/218170464-549eebd1-3178-42da-9cb4-0e3d7edcf032.png";>
   
   


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