Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

Commit

Permalink
GIRAPH-1249
Browse files Browse the repository at this point in the history
closes #145
  • Loading branch information
atanu1991 authored and dlogothetis committed Sep 23, 2020
1 parent 643c7aa commit 1acb587
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Expand Up @@ -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;
}
}
Expand Up @@ -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}.
Expand Down Expand Up @@ -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);
}
)
);
Expand Down

0 comments on commit 1acb587

Please sign in to comment.