[ https://issues.apache.org/jira/browse/KAFKA-7996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16778198#comment-16778198 ]
Guozhang Wang commented on KAFKA-7996: -------------------------------------- I'd agree with [~mjsax]'s explanation here. More specifically the `timeout` semantics in `KafkaStreams#close` function is not for "enforcing to complete closing before this timeout", but "try to block on close for maximum of this time, and if it still not complete then give up and return false". The javadocs we wrote is intending for this purpose as well: {code} * Shutdown this {@code KafkaStreams} by signaling all the threads to stop, and then wait up to the timeout for the * threads to join. {code} If we change the semantics to the former, then like stated above we need to inject this timeout all the way down to each modules being closed (similar to sth we did on other client), and I'm not sure if it is worthwhile to do: if lots of users found the current semantics inferior to the former, we can do that (which would be quite intrusive as we did before). So if the producer.close() is blocked which caused the close call to not be able to complete within the timeout, the KafkaStreams#close() call should return within timeout and users should get a "false" boolean. [~pkleindl] could you check if this is not the case you observed? > KafkaStreams does not pass timeout when closing Producer > -------------------------------------------------------- > > Key: KAFKA-7996 > URL: https://issues.apache.org/jira/browse/KAFKA-7996 > Project: Kafka > Issue Type: Bug > Components: streams > Affects Versions: 2.1.0 > Reporter: Patrik Kleindl > Assignee: Lee Dongjin > Priority: Major > Labels: needs-kip > > [https://confluentcommunity.slack.com/messages/C48AHTCUQ/convo/C48AHTCUQ-1550831721.026100/] > We are running 2.1 and have a case where the shutdown of a streams > application takes several minutes > I noticed that although we call streams.close with a timeout of 30 seconds > the log says > [Producer > clientId=…-8be49feb-8a2e-4088-bdd7-3c197f6107bb-StreamThread-1-producer] > Closing the Kafka producer with timeoutMillis = 9223372036854775807 ms. > Matthias J Sax [vor 3 Tagen] > I just checked the code, and yes, we don't provide a timeout for the producer > on close()... -- This message was sent by Atlassian JIRA (v7.6.3#76005)