Skip to content
Permalink
Browse files
GIRAPH-1249
closes #145
  • Loading branch information
atanu1991 authored and dlogothetis committed Sep 23, 2020
1 parent 643c7aa commit 1acb587f807a8e7b0e50bfd19b85a246db9e2abd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
@@ -1161,8 +1161,12 @@ public boolean checkIfWorkerShouldFail(Thread thread, Throwable exception) {
* @return True if the throwable is a "connection reset by peer",
* false otherwise.
*/
public static boolean isConnectionResetByPeer(Throwable throwable) {
return throwable.getMessage().startsWith(
"Connection reset by peer") ? true : false;
public static boolean isConnectionFailure(Throwable throwable) {
String erroMessage = throwable.getMessage().toLowerCase();
if (erroMessage.startsWith("connection reset by peer") ||
erroMessage.startsWith("connection timed out")) {
return true;
}
return false;
}
}
@@ -121,7 +121,7 @@

import com.google.common.collect.Lists;

import static org.apache.giraph.graph.GraphTaskManager.isConnectionResetByPeer;
import static org.apache.giraph.graph.GraphTaskManager.isConnectionFailure;

/**
* ZooKeeper-based implementation of {@link CentralizedServiceWorker}.
@@ -224,7 +224,7 @@ public BspServiceWorker(
// If the connection was closed by the client, then we just log
// the error, we do not fail the job, since the client will
// attempt to reconnect.
return !isConnectionResetByPeer(throwable);
return !isConnectionFailure(throwable);
}
)
);

0 comments on commit 1acb587

Please sign in to comment.