Skip to content

Commit

Permalink
[ISSUE #8712] Set namesrvAddrChoosed to null if choosed addr is not e…
Browse files Browse the repository at this point in the history
…xist (#8713)
  • Loading branch information
qianye1001 authored Sep 23, 2024
1 parent 945e7ea commit e8d1472
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,11 @@ public void updateNameServerAddressList(List<String> addrs) {
this.namesrvAddrList.set(addrs);

// should close the channel if choosed addr is not exist.
if (this.namesrvAddrChoosed.get() != null && !addrs.contains(this.namesrvAddrChoosed.get())) {
String namesrvAddr = this.namesrvAddrChoosed.get();
String chosenNameServerAddr = this.namesrvAddrChoosed.get();
if (chosenNameServerAddr != null && !addrs.contains(chosenNameServerAddr)) {
namesrvAddrChoosed.compareAndSet(chosenNameServerAddr, null);
for (String addr : this.channelTables.keySet()) {
if (addr.contains(namesrvAddr)) {
if (addr.contains(chosenNameServerAddr)) {
ChannelWrapper channelWrapper = this.channelTables.get(addr);
if (channelWrapper != null) {
channelWrapper.close();
Expand Down

0 comments on commit e8d1472

Please sign in to comment.