You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/01/14 12:33:19 UTC

[GitHub] WillemJiang commented on a change in pull request #113: SCB-211 wait until connection recover instead of try sending

WillemJiang commented on a change in pull request #113: SCB-211 wait until connection recover instead of try sending
URL: https://github.com/apache/incubator-servicecomb-saga/pull/113#discussion_r161396046
 
 

 ##########
 File path: omega/omega-connector/omega-connector-grpc/src/main/java/org/apache/servicecomb/saga/omega/connector/grpc/LoadBalancedClusterMessageSender.java
 ##########
 @@ -139,10 +145,27 @@ public void send(TxEvent event) {
 
         // very large latency on exception
         senders.put(messageSender, Long.MAX_VALUE);
+
+        waitTillAnyConnectionAvailable();
       }
     } while (!success && !Thread.currentThread().isInterrupted());
   }
 
+  private void waitTillAnyConnectionAvailable() {
+    MessageSender sender = fastestSender();
+    // no connection available
+    if (senders.get(sender) == Long.MAX_VALUE) {
+      lock.lock();
+      try {
+        condition.await();
 
 Review comment:
   Do we have timeout off it?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services