kafka-1228; Socket Leak on ReplicaFetcherThread; patched by Ahmy Yulrizka; reviewed by Jun Rao

This commit is contained in:
Ahmy Yulrizka 2014-01-30 10:14:53 -08:00 committed by Jun Rao
parent 9c1d8e35c5
commit 2b0c6a7d7b
1 changed files with 4 additions and 5 deletions

View File

@ -72,19 +72,18 @@ class SimpleConsumer(val host: String,
blockingChannel.send(request)
response = blockingChannel.receive()
} catch {
case e : java.io.IOException =>
info("Reconnect due to socket error: %s".format(e.getMessage))
case e : Throwable =>
warn("Reconnect due to socket error: %s".format(e.getMessage))
// retry once
try {
reconnect()
blockingChannel.send(request)
response = blockingChannel.receive()
} catch {
case ioe: java.io.IOException =>
case e: Throwable =>
disconnect()
throw ioe
throw e
}
case e: Throwable => throw e
}
response
}