HADOOP-11599. Client#getTimeout should use IPC_CLIENT_PING_DEFAULT when IPC_CLIENT_PING_KEY is not configured. Contributed by zhihai xu.

(cherry picked from commit 3f56a4cb0c)
This commit is contained in:
Tsuyoshi Ozawa 2015-02-18 17:32:50 +09:00
parent 6c01e58619
commit f10335b08d
3 changed files with 11 additions and 1 deletions

View File

@ -553,6 +553,9 @@ Release 2.7.0 - UNRELEASED
HADOOP-11295. RPC Server Reader thread can't shutdown if RPCCallQueue is HADOOP-11295. RPC Server Reader thread can't shutdown if RPCCallQueue is
full. (Ming Ma via kihwal) full. (Ming Ma via kihwal)
HADOOP-11599. Client#getTimeout should use IPC_CLIENT_PING_DEFAULT when
IPC_CLIENT_PING_KEY is not configured. (zhihai xu via ozawa)
Release 2.6.1 - UNRELEASED Release 2.6.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -236,7 +236,8 @@ final public static int getPingInterval(Configuration conf) {
* @return the timeout period in milliseconds. -1 if no timeout value is set * @return the timeout period in milliseconds. -1 if no timeout value is set
*/ */
final public static int getTimeout(Configuration conf) { final public static int getTimeout(Configuration conf) {
if (!conf.getBoolean(CommonConfigurationKeys.IPC_CLIENT_PING_KEY, true)) { if (!conf.getBoolean(CommonConfigurationKeys.IPC_CLIENT_PING_KEY,
CommonConfigurationKeys.IPC_CLIENT_PING_DEFAULT)) {
return getPingInterval(conf); return getPingInterval(conf);
} }
return -1; return -1;

View File

@ -1235,6 +1235,12 @@ public void run() {
} }
} }
@Test
public void testClientGetTimeout() throws IOException {
Configuration config = new Configuration();
assertEquals(Client.getTimeout(config), -1);
}
private void assertRetriesOnSocketTimeouts(Configuration conf, private void assertRetriesOnSocketTimeouts(Configuration conf,
int maxTimeoutRetries) throws IOException { int maxTimeoutRetries) throws IOException {
SocketFactory mockFactory = Mockito.mock(SocketFactory.class); SocketFactory mockFactory = Mockito.mock(SocketFactory.class);