kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Gustafson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KAFKA-3822) Kafka Consumer close() hangs indefinitely if Kafka Broker shutdown while connected
Date Wed, 29 Jun 2016 18:35:05 GMT

    [ https://issues.apache.org/jira/browse/KAFKA-3822?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15355584#comment-15355584
] 

Jason Gustafson commented on KAFKA-3822:
----------------------------------------

[~singhashish] There are two reasons why we might block in close(). First, if autocommit is
enabled, we can block waiting for the final commit to complete. Second, the consumer typically
needs to send a LeaveGroup request to ensure that the group can reassign its partitions without
waiting for the session timeout. There may be other reasons in the future why we need to block
there as well. I think letting the user provide a timeout in close() and the other blocking
methods gives the most flexibility, but it does clutter the API a little bit and it's not
clear if that much flexibility is really needed. Maybe we just need to choose one option,
list the other in the rejected alternatives, and see how the discussion pans out.

> Kafka Consumer close() hangs indefinitely if Kafka Broker shutdown while connected
> ----------------------------------------------------------------------------------
>
>                 Key: KAFKA-3822
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3822
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>    Affects Versions: 0.9.0.1, 0.10.0.0
>         Environment: x86 Red Hat 6 (1 broker running zookeeper locally, client running
on a separate server)
>            Reporter: Alexander Cook
>            Assignee: Ashish K Singh
>
> I am using the KafkaConsumer java client to consume messages. My application shuts down
smoothly if I am connected to a Kafka broker, or if I never succeed at connecting to a Kafka
broker, but if the broker is shut down while my consumer is connected to it, consumer.close()
hangs indefinitely. 
> Here is how I reproduce it: 
> 1. Start 0.9.0.1 Kafka Broker
> 2. Start consumer application and consume messages
> 3. Stop 0.9.0.1 Kafka Broker (ctrl-c or stop script)
> 4. Try to stop application...hangs at consumer.close() indefinitely. 
> I also see this same behavior using 0.10 broker and client. 
> This is my first bug reported to Kafka, so please let me know if I should be following
a different format. Thanks! 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message