[ 
https://issues.apache.org/jira/browse/GEODE-8202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17242270#comment-17242270
 ] 

ASF GitHub Bot commented on GEODE-8202:
---------------------------------------

alb3rtobr commented on a change in pull request #5600:
URL: https://github.com/apache/geode/pull/5600#discussion_r534093886



##########
File path: 
geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcher.java
##########
@@ -348,11 +349,56 @@ public void destroyConnection() {
     }
   }
 
+  Connection retryInitializeConnection(Connection con) {
+    final boolean isDebugEnabled = logger.isDebugEnabled();
+    ServerLocation server = this.sender.getServerLocation();
+    String connectedServerId = con.getEndpoint().getMemberId().getUniqueId();
+    String expectedServerId = this.processor.getExpectedReceiverUniqueId();
+    boolean connectedToExpectedReceiver = 
connectedServerId.equals(expectedServerId);
+    if (expectedServerId.equals("")) {
+      if (isDebugEnabled) {
+        logger.debug("First dispatcher connected to endpoint " + 
connectedServerId);
+      }
+      this.processor.setExpectedReceiverUniqueId(connectedServerId);
+      connectedToExpectedReceiver = true;
+    }
+    int attempt = 0;
+    final int maxAttempts = 5;

Review comment:
       With the approach I was suggesting, we will have `x * y ` attempts to 
connect to the desired receiver, being `x=5` (or any other number) and 
`y=<number of receivers under same ip and port>`.
   
   I think this is a high enough number to guarantee we reach the receiver we 
want. As you said, we are not setting the probability of not reaching the 
proper server to zero, but I think we are reducing it to a reasonable value.
   
   I will add a commit with the change.
   
   




----------------------------------------------------------------
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:
us...@infra.apache.org


> New option for serial gw sender threads start when receivers share ip and port
> ------------------------------------------------------------------------------
>
>                 Key: GEODE-8202
>                 URL: https://issues.apache.org/jira/browse/GEODE-8202
>             Project: Geode
>          Issue Type: Improvement
>            Reporter: Alberto Bustamante Reyes
>            Assignee: Alberto Bustamante Reyes
>            Priority: Major
>              Labels: pull-request-available
>
> RFC: 
> [https://cwiki.apache.org/confluence/display/GEODE/New+option+for+serial+gw+sender+dispatcher+threads+start|https://cwiki.apache.org/confluence/display/GEODE/New+option+for+serial+gw+sender+dispatcher+threads+start]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to