Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Kafka >> mail # dev >> Review Request 17671: Enable kafka server to keep retrying controlled shutdown with value -1


Copy link to this message
-
Re: Review Request 17671: Enable kafka server to keep retrying controlled shutdown with value -1

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/17671/
-----------------------------------------------------------

(Updated Feb. 3, 2014, 8:07 p.m.)
Review request for kafka.
Bugs: KAFKA-1235
    https://issues.apache.org/jira/browse/KAFKA-1235
Repository: kafka
Description (updated)
-------

Also including several fixes in this patch:

1. Check if channel is null or not for disconnecting instead of checking the isConnected variable, since otherwise a socket can be opened but not connected due to an exception, and hence lead to socket leak on channel.disconnect().

2. Make sure all connect() is guarded by a disconnect in the catch clause. This is also for socket leak prevention.

3. When closing the channel, check both channel and readChannel to see if they are null separately to avoid NPE.

4. Let the RequestSendThread to give up retrying sending to a broker if it is being shutdown, since its socket server may already be closed but itself is blocked on fully shutdown, hence leading to deadlock.
Diffs
-----

  core/src/main/scala/kafka/consumer/SimpleConsumer.scala 6dae149adfd4bfaa0d98aa641dfc41b00fcb6162
  core/src/main/scala/kafka/controller/ControllerChannelManager.scala ea8485b479155b479c575ebc89a4f73086c872cb
  core/src/main/scala/kafka/network/BlockingChannel.scala d22dabdf4fc2346c5487b9fd94cadfbcab70040d
  core/src/main/scala/kafka/producer/SyncProducer.scala 041cfa59c18fa04706d28e98e58fda3937b6c992
  core/src/main/scala/kafka/server/KafkaConfig.scala 3c3aafc2b3f06fc8f3168a8a9c1e0b08e944c1ef
  core/src/main/scala/kafka/server/KafkaServer.scala 5e34f95e64eaf12ae7e904ffef32422a365eca86

Diff: https://reviews.apache.org/r/17671/diff/
Testing (updated)
-------

unit-tests
Thanks,

Guozhang Wang