You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by ji...@apache.org on 2020/05/29 15:08:48 UTC

[rocketmq] branch develop updated: select a new namesrv when namesrvAddrChoosed not in new addr list

This is an automated email from the ASF dual-hosted git repository.

jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new 3245bd3  select a new namesrv when namesrvAddrChoosed not in new addr list
     new b3ec283  Merge pull request #2043 from wqliang/selectNamesrv
3245bd3 is described below

commit 3245bd3cc604ca7ad30b29eb8469102320478a2d
Author: wqliang <wq...@gmail.com>
AuthorDate: Mon May 25 23:59:33 2020 +0800

    select a new namesrv when namesrvAddrChoosed not in new addr list
---
 .../java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java  | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java
index 415d495..d836c8e 100644
--- a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java
+++ b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java
@@ -354,6 +354,10 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti
                 Collections.shuffle(addrs);
                 log.info("name server address updated. NEW : {} , OLD: {}", addrs, old);
                 this.namesrvAddrList.set(addrs);
+
+                if (!addrs.contains(this.namesrvAddrChoosed.get())) {
+                    this.namesrvAddrChoosed.set(null);
+                }
             }
         }
     }