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


##########
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:
   I will bump the release to avoid these checks if dealing with a current 
release
   



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