dubbo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [dubbo] jiangxch commented on a change in pull request #8211: [ISSUE-#8210] fix connectSync not work
Date Tue, 06 Jul 2021 11:42:25 GMT

jiangxch commented on a change in pull request #8211:
URL: https://github.com/apache/dubbo/pull/8211#discussion_r664048140



##########
File path: dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/Connection.java
##########
@@ -149,14 +153,16 @@ public void onGoaway(Channel channel) {
 
     public void onConnected(Channel channel) {
         this.channel.set(channel);
+        this.onConnectFuture.complete(new Object());
         channel.attr(CONNECTION).set(this);
         if (logger.isInfoEnabled()) {
             logger.info(String.format("%s connected ", this));
         }
     }
 
-    public void connectSync() {
+    public void connectSync() throws InterruptedException, ExecutionException, TimeoutException
{
         this.initPromise.awaitUninterruptibly(this.connectTimeout);
+        this.onConnectFuture.get(this.connectTimeout, TimeUnit.MILLISECONDS);

Review comment:
       ok




-- 
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: notifications-unsubscribe@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Mime
View raw message