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

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new 52b674e  Fix isSelf address. (#3051)
52b674e is described below

commit 52b674e3a55c2f6197e2b3adef15ff947576cd2a
Author: Alan Lau <[email protected]>
AuthorDate: Fri Jul 12 07:25:41 2019 +0800

    Fix isSelf address. (#3051)
---
 .../skywalking/oap/server/cluster/plugin/etcd/EtcdCoordinator.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/oap-server/server-cluster-plugin/cluster-etcd-plugin/src/main/java/org/apache/skywalking/oap/server/cluster/plugin/etcd/EtcdCoordinator.java
 
b/oap-server/server-cluster-plugin/cluster-etcd-plugin/src/main/java/org/apache/skywalking/oap/server/cluster/plugin/etcd/EtcdCoordinator.java
index 8a7df69..b614158 100644
--- 
a/oap-server/server-cluster-plugin/cluster-etcd-plugin/src/main/java/org/apache/skywalking/oap/server/cluster/plugin/etcd/EtcdCoordinator.java
+++ 
b/oap-server/server-cluster-plugin/cluster-etcd-plugin/src/main/java/org/apache/skywalking/oap/server/cluster/plugin/etcd/EtcdCoordinator.java
@@ -68,7 +68,11 @@ public class EtcdCoordinator implements ClusterRegister, 
ClusterNodesQuery {
             if (nodes != null) {
                 nodes.forEach(node -> {
                     EtcdEndpoint endpoint = gson.fromJson(node.getValue(), 
EtcdEndpoint.class);
-                    res.add(new RemoteInstance(new Address(endpoint.getHost(), 
endpoint.getPort(), true)));
+                    Address address = new Address(endpoint.getHost(), 
endpoint.getPort(), true);
+                    if (!address.equals(selfAddress)) {
+                        address.setSelf(false);
+                    }
+                    res.add(new RemoteInstance(address));
                 });
             }
 

Reply via email to