chickenlj commented on a change in pull request #7657:
URL: https://github.com/apache/dubbo/pull/7657#discussion_r827573606



##########
File path: 
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
##########
@@ -642,10 +646,9 @@ private Integer findConfigedPorts(ProtocolConfig 
protocolConfig,
                 portToBind = defaultPort;
             }
             if (portToBind <= 0) {
-                portToBind = getRandomPort(name);
+                portToBind = getRandomPort(protocolConfig.getId());
                 if (portToBind == null || portToBind < 0) {
-                    portToBind = getAvailablePort(defaultPort);
-                    putRandomPort(name, portToBind);
+                    portToBind = 
getAndSaveAvailablePort(protocolConfig.getId(), 20880);

Review comment:
       像这种情况,最好还是只定义一个 protocol 
实例,并保持一种默认序列化协议如hessian,其余需要独立设置序列化的服务最好单独设置在服务上。




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