From 9aa2f51812e28c0f30299b17f6bbc181fbfa30d4 Mon Sep 17 00:00:00 2001 From: Andrew Wang Date: Thu, 31 Oct 2013 20:55:19 +0000 Subject: [PATCH] HADOOP-9898. Set SO_KEEPALIVE on all our sockets. Contributed by Todd Lipcon. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1537637 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 2 ++ .../src/main/java/org/apache/hadoop/ipc/Client.java | 1 + .../src/main/java/org/apache/hadoop/ipc/Server.java | 1 + 3 files changed, 4 insertions(+) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 636a10a3ad1..60f94456e9a 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -452,6 +452,8 @@ Release 2.2.1 - UNRELEASED HADOOP-10072. TestNfsExports#testMultiMatchers fails due to non-deterministic timing around cache expiry check. (cnauroth) + HADOOP-9898. Set SO_KEEPALIVE on all our sockets. (todd via wang) + Release 2.2.0 - 2013-10-13 INCOMPATIBLE CHANGES 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 8caa7b288ba..b444a115cb5 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 @@ -575,6 +575,7 @@ public class Client { try { this.socket = socketFactory.createSocket(); this.socket.setTcpNoDelay(tcpNoDelay); + this.socket.setKeepAlive(true); /* * Bind the socket to the host specified in the principal name of the diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java index ec5fff74996..89f9501d980 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java @@ -762,6 +762,7 @@ public abstract class Server { channel.configureBlocking(false); channel.socket().setTcpNoDelay(tcpNoDelay); + channel.socket().setKeepAlive(true); Reader reader = getReader(); try {