nikhiln64 opened a new pull request, #8191:
URL: https://github.com/apache/incubator-seata/pull/8191

   - [x] I have read the 
[CONTRIBUTING.md](https://github.com/apache/incubator-seata/blob/2.x/CONTRIBUTING.md)
 guidelines.
   - [x] I have registered the PR 
[changes](https://github.com/apache/incubator-seata/tree/2.x/changes).
   
   ### Ⅰ. Describe what this PR did
   
   NetUtil.getIgnoredInterfacesLocalAddress returned the global LOCAL_ADDRESS 
cache as soon as it was populated, so ignoredInterfaces and preferredNetworks 
were silently skipped whenever any earlier call had cached the default address. 
The cache predates the interface filtering support added in #8090.
   
   This change makes parameterized lookups evaluate their own filters. A call 
with non empty ignoredInterfaces or preferredNetworks now resolves through 
getLocalAddress0 directly and neither reads nor overwrites the default cache, 
while the unfiltered lookup keeps its existing caching behavior. This follows 
the direction suggested in the issue.
   
   ### Ⅱ. Does this pull request fix one issue?
   
   fixes #8169
   
   ### Ⅲ. Why don't you add test cases (unit test/integration test)?
   
   Three tests are added to NetUtilTest. The first is the failing regression 
from the issue, a lookup ignoring every interface must return null even after 
the default address was cached. The second asserts a filtered lookup does not 
clear or replace the default cache. The third asserts a preferred network 
lookup resolves through the interface scan and leaves the cache intact.
   
   ### Ⅳ. Describe how to verify it
   
   Run mvn -pl common test -Dtest=NetUtilTest on the branch. Reverting the 
NetUtil change makes testIgnoredInterfacesAreAppliedAfterDefaultAddressIsCached 
fail with the cached address being returned, which is the reproduction from the 
issue.
   
   ### Ⅴ. Special notes for reviews
   
   Impact is limited to callers that pass filters after another code path 
already resolved the default address. The unfiltered path is unchanged. The 
changelog entry is registered in changes/en-us/2.x.md and changes/zh-cn/2.x.md.


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