clebertsuconic commented on code in PR #5145:
URL: https://github.com/apache/activemq-artemis/pull/5145#discussion_r1715320630


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/quorum/QuorumManager.java:
##########
@@ -348,19 +377,42 @@ public synchronized void voteComplete() {
       }
    }
 
-   private Vote sendQuorumVote(ClusterControl clusterControl, SimpleString 
handler, Vote vote) {
+   private Vote sendQuorumVote(ClusterControl clusterControl, SimpleString 
handler, SimpleString oldHandlerName, Vote vote) {
       try {
          final ClientSessionFactoryInternal sessionFactory = 
clusterControl.getSessionFactory();
          final String remoteAddress = 
sessionFactory.getConnection().getRemoteAddress();
          ActiveMQServerLogger.LOGGER.sendingQuorumVoteRequest(remoteAddress, 
vote.toString());
-         QuorumVoteReplyMessage replyMessage = (QuorumVoteReplyMessage) 
clusterControl.getClusterChannel().get()
-            .sendBlocking(new QuorumVoteMessage(handler, vote), 
PacketImpl.QUORUM_VOTE_REPLY);
+
+         QuorumVoteReplyMessage replyMessage = null;
+
+         Channel clusterChannel = clusterControl.getClusterChannel().get();
+
+
+         // We first try the current packet with a medium timeout
+         replyMessage = (QuorumVoteReplyMessage) 
clusterChannel.sendBlocking(new QuorumVoteMessage(handler, vote), -1, 
PacketImpl.QUORUM_VOTE_REPLY, VOTE_RESPONSE_TIMEOUT, false);
+         logger.trace("This is the reply message from the current version = 
{}", replyMessage);
+
+         // if no response, we try the previous versions, with still a medium 
timeout
+         if (replyMessage == null && oldHandlerName != null) {
+            replyMessage = (QuorumVoteReplyMessage) 
clusterChannel.sendBlocking(new QuorumVoteMessage(oldHandlerName, vote), -1, 
PacketImpl.QUORUM_VOTE_REPLY, VOTE_RESPONSE_TIMEOUT, false);
+            logger.trace("This is the reply message from the older version = 
{}", replyMessage);
+         }

Review Comment:
   We could stop looking for this on a newer wire version... for sure.
   
   I actually thought about upgrading the wire now, and skip these short 
timeouts. I had it written at some point and I reverted it... 
   
   (I thought these retries would been enough)
   
   
   To have these reply Messages being delayed more than 2 seconds here it would 
mean things are really bad for the cluster anyway. a Retry with the same 
serverID seemed enough to me here.
   
   
   I could upgrade the wire now and not have these checks on current versions. 
WDYT?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to