Repository: hadoop Updated Branches: refs/heads/branch-2 6c01e5861 -> f10335b08
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 3f56a4cb0c57583e285e85a4d0c1584c4de9f1f1) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/f10335b0 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/f10335b0 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/f10335b0 Branch: refs/heads/branch-2 Commit: f10335b08d51ec3edff16ab2e2fbea3dccb5e8bb Parents: 6c01e58 Author: Tsuyoshi Ozawa <[email protected]> Authored: Wed Feb 18 17:32:50 2015 +0900 Committer: Tsuyoshi Ozawa <[email protected]> Committed: Wed Feb 18 18:00:18 2015 +0900 ---------------------------------------------------------------------- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/ipc/Client.java | 3 ++- .../src/test/java/org/apache/hadoop/ipc/TestIPC.java | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/f10335b0/hadoop-common-project/hadoop-common/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 8e45ba6..6f03cc7 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -553,6 +553,9 @@ Release 2.7.0 - UNRELEASED HADOOP-11295. RPC Server Reader thread can't shutdown if RPCCallQueue is 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 INCOMPATIBLE CHANGES http://git-wip-us.apache.org/repos/asf/hadoop/blob/f10335b0/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java index d7ff390..8207081 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java @@ -236,7 +236,8 @@ public class Client { * @return the timeout period in milliseconds. -1 if no timeout value is set */ 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 -1; http://git-wip-us.apache.org/repos/asf/hadoop/blob/f10335b0/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestIPC.java ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestIPC.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestIPC.java index 04a7412..eb19f48 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestIPC.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ipc/TestIPC.java @@ -1235,6 +1235,12 @@ public class TestIPC { } } + @Test + public void testClientGetTimeout() throws IOException { + Configuration config = new Configuration(); + assertEquals(Client.getTimeout(config), -1); + } + private void assertRetriesOnSocketTimeouts(Configuration conf, int maxTimeoutRetries) throws IOException { SocketFactory mockFactory = Mockito.mock(SocketFactory.class);
