HADOOP-17552. Change ipc.client.rpc-timeout.ms from 0 to 120000 by default to avoid potential hang. (#2727)

This commit is contained in:
Haoze Wu 2021-03-06 08:26:16 -05:00 committed by GitHub
parent c6b30a59dd
commit ef7ab535c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -58,7 +58,7 @@ public class CommonConfigurationKeys extends CommonConfigurationKeysPublic {
public static final String IPC_CLIENT_RPC_TIMEOUT_KEY =
"ipc.client.rpc-timeout.ms";
/** Default value for IPC_CLIENT_RPC_TIMEOUT_KEY. */
public static final int IPC_CLIENT_RPC_TIMEOUT_DEFAULT = 0;
public static final int IPC_CLIENT_RPC_TIMEOUT_DEFAULT = 120000;
/** Responses larger than this will be logged */
public static final String IPC_SERVER_RPC_MAX_RESPONSE_SIZE_KEY =
"ipc.server.max.response.size";

View File

@ -2383,9 +2383,10 @@
<property>
<name>ipc.client.rpc-timeout.ms</name>
<value>0</value>
<value>120000</value>
<description>Timeout on waiting response from server, in milliseconds.
If ipc.client.ping is set to true and this rpc-timeout is greater than
If this rpc-timeout is 0, it means no timeout. If this rpc-timeout is greater
than 0, and ipc.client.ping is set to true, and this rpc-timeout is greater than
the value of ipc.ping.interval, the effective value of the rpc-timeout is
rounded up to multiple of ipc.ping.interval.
</description>

View File

@ -1456,6 +1456,7 @@ public void run() {
@Test
public void testClientGetTimeout() throws IOException {
Configuration config = new Configuration();
config.setInt(CommonConfigurationKeys.IPC_CLIENT_RPC_TIMEOUT_KEY, 0);
assertThat(Client.getTimeout(config)).isEqualTo(-1);
}