kafka-2096; Enable keepalive socket option for broker to prevent socket leak; patched by Allen Wang; reviewed by Jun Rao

This commit is contained in:
Allen Wang 2015-04-08 17:21:29 -07:00 committed by Jun Rao
parent 6880f66c97
commit 194d1fc030
1 changed files with 1 additions and 0 deletions

1
core/src/main/scala/kafka/network/SocketServer.scala Executable file → Normal file
View File

@ -308,6 +308,7 @@ private[kafka] class Acceptor(val host: String,
connectionQuotas.inc(socketChannel.socket().getInetAddress)
socketChannel.configureBlocking(false)
socketChannel.socket().setTcpNoDelay(true)
socketChannel.socket().setKeepAlive(true)
socketChannel.socket().setSendBufferSize(sendBufferSize)
debug("Accepted connection from %s on %s. sendBufferSize [actual|requested]: [%d|%d] recvBufferSize [actual|requested]: [%d|%d]"