You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2021/02/24 19:17:23 UTC

[GitHub] [activemq-artemis] clebertsuconic commented on a change in pull request #3468: ARTEMIS-3138 Shared Nothing Live broker shouldn't try to connect to itself

clebertsuconic commented on a change in pull request #3468:
URL: https://github.com/apache/activemq-artemis/pull/3468#discussion_r582233288



##########
File path: artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorImpl.java
##########
@@ -1546,20 +1546,22 @@ public synchronized void connectorsChanged(List<DiscoveryEntry> newConnectors) {
       if (receivedTopology) {
          return;
       }
-      TransportConfiguration[] newInitialconnectors = (TransportConfiguration[]) Array.newInstance(TransportConfiguration.class, newConnectors.size());
 
-      int count = 0;
-      for (DiscoveryEntry entry : newConnectors) {
-         newInitialconnectors[count++] = entry.getConnector();
+      final List<TransportConfiguration> newInitialconnectors = new ArrayList<>(newConnectors.size());
 
+      for (DiscoveryEntry entry : newConnectors) {
          if (ha && topology.getMember(entry.getNodeID()) == null) {
             TopologyMemberImpl member = new TopologyMemberImpl(entry.getNodeID(), null, null, entry.getConnector(), null);
             // on this case we set it as zero as any update coming from server should be accepted
             topology.updateMember(0, entry.getNodeID(), member);
          }
+         // ignore its own transport connector
+         if (!entry.getConnector().equals(clusterTransportConfiguration)) {

Review comment:
       I think a core connection would get the topology sent to clients from the ClusterConnections's ServerLocator.
   
   As long as your own connection is getting into the Topology for the clients, this is ok.
   
   I know the test suite is passing, but did you check if the topology is being updated somewhere else? 
   
   
   just wanted to make sure the test suite passed intentionally and not by an accident like other nodes would give you the update to the clients. 




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org