You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@giraph.apache.org by di...@apache.org on 2020/09/23 18:08:58 UTC
[giraph] branch trunk updated: GIRAPH-1249
This is an automated email from the ASF dual-hosted git repository.
dionysios pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/giraph.git
The following commit(s) were added to refs/heads/trunk by this push:
new 1acb587 GIRAPH-1249
1acb587 is described below
commit 1acb587f807a8e7b0e50bfd19b85a246db9e2abd
Author: Atanu Ghosh <at...@gmail.com>
AuthorDate: Wed Sep 23 11:08:34 2020 -0700
GIRAPH-1249
closes #145
---
.../main/java/org/apache/giraph/graph/GraphTaskManager.java | 10 +++++++---
.../main/java/org/apache/giraph/worker/BspServiceWorker.java | 4 ++--
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java b/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java
index 280d285..6b94163 100644
--- a/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java
+++ b/giraph-core/src/main/java/org/apache/giraph/graph/GraphTaskManager.java
@@ -1161,8 +1161,12 @@ end[PURE_YARN]*/
* @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;
}
}
diff --git a/giraph-core/src/main/java/org/apache/giraph/worker/BspServiceWorker.java b/giraph-core/src/main/java/org/apache/giraph/worker/BspServiceWorker.java
index a745b1e..9a8f592 100644
--- a/giraph-core/src/main/java/org/apache/giraph/worker/BspServiceWorker.java
+++ b/giraph-core/src/main/java/org/apache/giraph/worker/BspServiceWorker.java
@@ -121,7 +121,7 @@ import org.json.JSONObject;
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 class BspServiceWorker<I extends WritableComparable,
// 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);
}
)
);