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

Add connection timed out to list of failures for uncaught Excep Handler #125

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1193,8 +1193,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 throwableMessage = throwable.getMessage().toLowerCase();
if (throwableMessage.startsWith("connection reset by peer") ||
throwableMessage.startsWith("connection timed out")) {
return true;
}
return false;
}
}
Original file line number Diff line number Diff line change
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