Copilot commented on code in PR #8191:
URL: https://github.com/apache/incubator-seata/pull/8191#discussion_r3699010297


##########
common/src/main/java/org/apache/seata/common/util/NetUtil.java:
##########
@@ -265,6 +265,12 @@ public static InetAddress getLocalAddress(String... 
preferredNetworks) {
      */
     public static InetAddress getIgnoredInterfacesLocalAddress(
             String[] ignoredInterfaces, String... preferredNetworks) {
+        // The global cache only ever holds the unfiltered default address, 
and it predates
+        // the interface filtering support (#8090). A parameterized lookup 
must evaluate its
+        // own filters, so it neither reads nor overwrites the default cache 
(#8169).
+        if (CollectionUtils.isNotEmpty(ignoredInterfaces) || 
CollectionUtils.isNotEmpty(preferredNetworks)) {
+            return getLocalAddress0(ignoredInterfaces, preferredNetworks);
+        }

Review Comment:
   The new cache-bypass condition treats any non-null/non-empty array as 
“filtered”. If callers pass an effectively empty ignoredInterfaces (e.g., 
config value "" split into [""], as in Server.java), this will now bypass the 
default cache even though no filtering is applied. That can cause extra 
interface scans and potentially inconsistent results across calls (since the 
default cache won’t be populated). Consider only bypassing the cache when there 
is at least one non-blank pattern in ignoredInterfaces or preferredNetworks.



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