BurningCN commented on code in PR #10342:
URL: https://github.com/apache/dubbo/pull/10342#discussion_r926211636


##########
dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/manager/DefaultExecutorRepository.java:
##########
@@ -83,8 +84,14 @@ public synchronized ExecutorService 
createExecutorIfAbsent(URL url) {
         Map<Integer, ExecutorService> executors = 
data.computeIfAbsent(getExecutorKey(url), k -> new ConcurrentHashMap<>());
         // Consumer's executor is sharing globally, key=Integer.MAX_VALUE. 
Provider's executor is sharing by protocol.
         Integer portKey = 
CONSUMER_SIDE.equalsIgnoreCase(url.getParameter(SIDE_KEY)) ? Integer.MAX_VALUE 
: url.getPort();
+
+        String protocol = url.getProtocol();
+        if (StringUtils.isEmpty(protocol)) {
+            protocol = DEFAULT_PROTOCOL;
+        }
+
         if (url.getParameter(THREAD_NAME_KEY) == null) {
-            url = url.putAttribute(THREAD_NAME_KEY, "Dubbo-protocol-" + 
portKey);
+            url = url.putAttribute(THREAD_NAME_KEY, protocol + "-protocol-" + 
portKey);

Review Comment:
   
   Can this logic be put in this? The protocol key is obtained only when the 
thread name key is not set
   (这段逻辑是否可以放到这个里面,只在没有设置线程名称key的时候,才会去获取protocol key)
   
![image](https://user-images.githubusercontent.com/43363120/180120643-d534c896-0852-4021-a0ec-e89c7e61d8d1.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