nikhiln64 commented on code in PR #8191:
URL: https://github.com/apache/incubator-seata/pull/8191#discussion_r3732886373
##########
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:
Good catch. Server.java splits the raw config value with String.split, so an
empty registry.ignoredInterfaces value does arrive here as a single blank
element and would have skipped the cache for no reason. The bypass now only
triggers when at least one pattern is non blank, blank only arrays fall through
to the cached default path exactly like a null argument. Added
testBlankPatternsStillUseDefaultCache covering both the ignoredInterfaces and
preferredNetworks variants, and the full NetUtilTest suite passes.
--
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]