YARN-2841. RMProxy should retry EOFException. Contributed by Jian He

This commit is contained in:
Xuan 2014-11-10 18:25:01 -08:00
parent 86bf8c7193
commit 5c9a51f140
4 changed files with 13 additions and 0 deletions

View File

@ -929,6 +929,8 @@ Release 2.6.0 - 2014-11-15
consistent with the (somewhat incorrect) behaviour in the non-recovery case.
(Jian He via vinodkv)
YARN-2841. RMProxy should retry EOFException. (Jian He via xgong)
Release 2.5.2 - 2014-11-10
INCOMPATIBLE CHANGES

View File

@ -18,6 +18,7 @@
package org.apache.hadoop.yarn.client;
import java.io.EOFException;
import java.io.IOException;
import java.net.ConnectException;
import java.net.InetSocketAddress;
@ -240,6 +241,7 @@ public static RetryPolicy createRetryPolicy(Configuration conf) {
Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
new HashMap<Class<? extends Exception>, RetryPolicy>();
exceptionToPolicyMap.put(EOFException.class, retryPolicy);
exceptionToPolicyMap.put(ConnectException.class, retryPolicy);
exceptionToPolicyMap.put(NoRouteToHostException.class, retryPolicy);
exceptionToPolicyMap.put(UnknownHostException.class, retryPolicy);

View File

@ -18,6 +18,7 @@
package org.apache.hadoop.yarn.client;
import java.io.EOFException;
import java.net.ConnectException;
import java.net.InetSocketAddress;
import java.net.NoRouteToHostException;
@ -67,6 +68,7 @@ protected static RetryPolicy createRetryPolicy(Configuration conf,
Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
new HashMap<Class<? extends Exception>, RetryPolicy>();
exceptionToPolicyMap.put(EOFException.class, retryPolicy);
exceptionToPolicyMap.put(ConnectException.class, retryPolicy);
exceptionToPolicyMap.put(NoRouteToHostException.class, retryPolicy);
exceptionToPolicyMap.put(UnknownHostException.class, retryPolicy);

View File

@ -21,6 +21,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.io.EOFException;
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
@ -737,8 +738,14 @@ public RegisterNodeManagerResponse registerNodeManager(
public NodeHeartbeatResponse nodeHeartbeat(NodeHeartbeatRequest request)
throws YarnException, IOException {
heartBeatID++;
if(heartBeatID == 1) {
// EOFException should be retried as well.
throw new EOFException("NodeHeartbeat exception");
}
else {
throw new java.net.ConnectException(
"NodeHeartbeat exception");
}
}
}