YARN-2841. RMProxy should retry EOFException. Contributed by Jian He
This commit is contained in:
parent
86bf8c7193
commit
5c9a51f140
|
@ -929,6 +929,8 @@ Release 2.6.0 - 2014-11-15
|
||||||
consistent with the (somewhat incorrect) behaviour in the non-recovery case.
|
consistent with the (somewhat incorrect) behaviour in the non-recovery case.
|
||||||
(Jian He via vinodkv)
|
(Jian He via vinodkv)
|
||||||
|
|
||||||
|
YARN-2841. RMProxy should retry EOFException. (Jian He via xgong)
|
||||||
|
|
||||||
Release 2.5.2 - 2014-11-10
|
Release 2.5.2 - 2014-11-10
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
package org.apache.hadoop.yarn.client;
|
package org.apache.hadoop.yarn.client;
|
||||||
|
|
||||||
|
import java.io.EOFException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.ConnectException;
|
import java.net.ConnectException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
|
@ -240,6 +241,7 @@ public class RMProxy<T> {
|
||||||
Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
|
Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
|
||||||
new HashMap<Class<? extends Exception>, RetryPolicy>();
|
new HashMap<Class<? extends Exception>, RetryPolicy>();
|
||||||
|
|
||||||
|
exceptionToPolicyMap.put(EOFException.class, retryPolicy);
|
||||||
exceptionToPolicyMap.put(ConnectException.class, retryPolicy);
|
exceptionToPolicyMap.put(ConnectException.class, retryPolicy);
|
||||||
exceptionToPolicyMap.put(NoRouteToHostException.class, retryPolicy);
|
exceptionToPolicyMap.put(NoRouteToHostException.class, retryPolicy);
|
||||||
exceptionToPolicyMap.put(UnknownHostException.class, retryPolicy);
|
exceptionToPolicyMap.put(UnknownHostException.class, retryPolicy);
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
package org.apache.hadoop.yarn.client;
|
package org.apache.hadoop.yarn.client;
|
||||||
|
|
||||||
|
import java.io.EOFException;
|
||||||
import java.net.ConnectException;
|
import java.net.ConnectException;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.NoRouteToHostException;
|
import java.net.NoRouteToHostException;
|
||||||
|
@ -67,6 +68,7 @@ public class ServerProxy {
|
||||||
|
|
||||||
Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
|
Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
|
||||||
new HashMap<Class<? extends Exception>, RetryPolicy>();
|
new HashMap<Class<? extends Exception>, RetryPolicy>();
|
||||||
|
exceptionToPolicyMap.put(EOFException.class, retryPolicy);
|
||||||
exceptionToPolicyMap.put(ConnectException.class, retryPolicy);
|
exceptionToPolicyMap.put(ConnectException.class, retryPolicy);
|
||||||
exceptionToPolicyMap.put(NoRouteToHostException.class, retryPolicy);
|
exceptionToPolicyMap.put(NoRouteToHostException.class, retryPolicy);
|
||||||
exceptionToPolicyMap.put(UnknownHostException.class, retryPolicy);
|
exceptionToPolicyMap.put(UnknownHostException.class, retryPolicy);
|
||||||
|
|
|
@ -21,6 +21,7 @@ package org.apache.hadoop.yarn.server.nodemanager;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
import static org.mockito.Mockito.when;
|
import static org.mockito.Mockito.when;
|
||||||
|
|
||||||
|
import java.io.EOFException;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
|
@ -737,8 +738,14 @@ public class TestNodeStatusUpdater {
|
||||||
public NodeHeartbeatResponse nodeHeartbeat(NodeHeartbeatRequest request)
|
public NodeHeartbeatResponse nodeHeartbeat(NodeHeartbeatRequest request)
|
||||||
throws YarnException, IOException {
|
throws YarnException, IOException {
|
||||||
heartBeatID++;
|
heartBeatID++;
|
||||||
|
if(heartBeatID == 1) {
|
||||||
|
// EOFException should be retried as well.
|
||||||
|
throw new EOFException("NodeHeartbeat exception");
|
||||||
|
}
|
||||||
|
else {
|
||||||
throw new java.net.ConnectException(
|
throw new java.net.ConnectException(
|
||||||
"NodeHeartbeat exception");
|
"NodeHeartbeat exception");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue