Radeity commented on code in PR #243:
URL: 
https://github.com/apache/incubator-hugegraph-computer/pull/243#discussion_r1202163755


##########
computer-core/src/main/java/org/apache/hugegraph/computer/core/receiver/MessageRecvManager.java:
##########
@@ -138,35 +146,24 @@ public void onChannelInactive(ConnectionId connectionId) {
     @Override
     public void exceptionCaught(TransportException cause,
                                 ConnectionId connectionId) {
-        // TODO: implement failover
-        LOG.warn("Exception caught for connection:{}, root cause:",
+        LOG.error("Exception caught for connection:{}, root cause:",
                  connectionId, cause);
+        this.finishMessagesFuture.completeExceptionally(cause);
     }
 
     public void waitReceivedAllMessages() {
         try {
-            boolean status = this.finishMessagesLatch.await(
-                             this.waitFinishMessagesTimeout,
-                             TimeUnit.MILLISECONDS);
-            if (!status) {
-                throw new ComputerException(
-                          "Expect %s finish-messages received in %s ms, " +
-                          "%s absence in superstep %s",
-                          this.expectedFinishMessages,
-                          this.waitFinishMessagesTimeout,
-                          this.finishMessagesLatch.getCount(),
-                          this.superstep);
-            }
-        } catch (InterruptedException e) {
+            finishMessagesFuture.get(
+                    this.waitFinishMessagesTimeout,
+                    TimeUnit.MILLISECONDS);
+        } catch (Exception e) {
             throw new ComputerException(
-                      "Thread is interrupted while waiting %s " +
-                      "finish-messages received in %s ms, " +
-                      "%s absence in superstep %s",
-                      e,
-                      this.expectedFinishMessages,
-                      this.waitFinishMessagesTimeout,
-                      this.finishMessagesLatch.getCount(),
-                      this.superstep);
+                    "Thread is interrupted while waiting %s " +
+                            "finish-messages received in %s ms in superstep 
%s",
+                    e,
+                    this.expectedFinishMessages,
+                    this.waitFinishMessagesTimeout,

Review Comment:
   Do you mean we should catch them with different error message?



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

Reply via email to