funky-eyes commented on code in PR #7170:
URL: https://github.com/apache/incubator-seata/pull/7170#discussion_r1961043996


##########
core/src/main/java/org/apache/seata/core/rpc/netty/NettyClientConfig.java:
##########
@@ -346,11 +345,13 @@ public static String getSocketAddressStartChar() {
 
     /**
      * Gets client selector thread size.
+     * If the configured thread size is less than or equal to 0, it returns 
the default value.
      *
-     * @return the client selector thread size
+     * @return the client selector thread size, or the default value if the 
configured size is invalid.
      */
     public int getClientSelectorThreadSize() {
-        return CONFIG.getInt(ConfigurationKeys.CLIENT_SELECTOR_THREAD_SIZE, 
DEFAULT_SELECTOR_THREAD_SIZE);
+        int threadSize = 
CONFIG.getInt(ConfigurationKeys.CLIENT_SELECTOR_THREAD_SIZE, 
WorkThreadMode.Default.getValue());
+        return threadSize > 0 ? threadSize : WorkThreadMode.Default.getValue();

Review Comment:
   You are right, handling it this way is better, good job.



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