-Re: Review Request 17671: Fix KAFKA-1235
Guozhang Wang 2014-02-19, 23:57
This is an automatically generated e-mail. To reply, visit:
(Updated Feb. 19, 2014, 11:57 p.m.)
Review request for kafka.
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. On shutdown, let the KafkaHealthCheck to progressively delete the registration path in ZK to resolve the controller-shutdown-itself deadlock.
5. Some unit tests setup/teardown ordering.