ZOOKEEPER-4708: recreateSocketAddresses before comparing addresses
Found 2 places we will compare the addresses to check if there's any major change, but the addresses comparison will compare hostname + IP address + port. If the DNS is slow, there might be chances that the hostname and port are identical, but the IP address has <unresolved> V.S. x.x.x.x. So the result will be the unexpected unequal.
This PR tried to recreateSocketAddresses before comparing the addresses to fix the issue.
Note: No tests added because it didn't change any logic. Just need to make sure it passes the existing tests.
Sonatype Lift is retiring
Sonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console. We are extremely grateful and thank you for your support over the years.
@symat @eolivelli , similar to https://github.com/apache/zookeeper/pull/2040 and https://github.com/apache/zookeeper/pull/1524. Call for review. Thanks.
@anmolnar , thanks for the comment. Tests added.
Note: It's not easy to test the slow DNS scenario, so I tried to verify the method is invoked as expected, alternatively.
Thanks.
@anmolnar , please take a look when available. Thanks.
@anmolnar , please take a look when available. Thanks.
@showuon You have checkstyle validation error
Error: /home/runner/work/zookeeper/zookeeper/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LeaderBeanTest.java:43:1: Extra separation in import group before 'org.apache.jute.OutputArchive' [ImportOrder]
@showuon You have checkstyle validation error
Error: /home/runner/work/zookeeper/zookeeper/zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LeaderBeanTest.java:43:1: Extra separation in import group before 'org.apache.jute.OutputArchive' [ImportOrder]
@anmolnar , fixed. Please also help backport to 3.8/3.9 branch if no other comments. Thank you very much.
The compatibility test failed on java 11 in 3.6.3, but passed on java 8 in 3.6.3. I think it should be fine. Thanks.
We have encountered an issue affecting over 50% of the test cases within our testing infrastructure. We would greatly appreciate it if we could move forward with addressing this issue.
^^ @eolivelli, @symat, @tisonkun, and @ztzg
I appreciate your attention to this matter in advance.
@eolivelli @symat @tisonkun @ztzg, please take a look when available. Thanks.
@eolivelli @symat @tisonkun @ztzg, please take a look. Thanks.
@eolivelli @symat @tisonkun @ztzg, please take a look. Thanks.
Will this be merged anytime soon? We would greatly appreciate if this was merged as our infrastructure is greatly affected by this issue