[ https://issues.apache.org/jira/browse/KAFKA-7996?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16789769#comment-16789769 ]
Lee Dongjin commented on KAFKA-7996: ------------------------------------ I double checked this issue, and found the following: 1. All of `Producer`, `Consumer`, and `AdminClient` has `CommonClientConfigs.REQUEST_TIMEOUT_MS_CONFIG` which controls network call timeout. However, `Consumer` has additional `ConsumerConfig#DEFAULT_API_TIMEOUT_MS_CONFIG` and uses it as a request timeout instead of `CommonClientConfigs.REQUEST_TIMEOUT_MS_CONFIG.` 2. When closing `Consumer` without any timeout duration, it closes with a timeout of `Consumer#DEFAULT_CLOSE_TIMEOUT_MS.` But in the case of `Producer` and `AdminClient,` there is no similar one - `Producer#close`'s default timeout is `Duration.ofMillis(Long.MAX_VALUE).` As far as I understand, it seems like there is no overall approach to handle close timeouts - and if it is true, we have three choices: 1. Add [Producer, AdminClient]#DEFAULT_CLOSE_TIMEOUT_MS and close with this default value. This approach doesn't require a KIP. 2. Use `ConsumerConfig#DEFAULT_API_TIMEOUT_MS_CONFIG` as a close timeout for all of `Producer`, `Consumer`, and `AdminClient`. This approach also doesn't require a KIP. 3. Provide additional timeout options for closing [Producer, Consumer, AdminClient] in `KafkaStreams` like the draft PR. This approach provides users a way to control the behavior, but it is an API change so requires a KIP. How do you think? cc/ [~mjsax] [~hachikuji] [~Yohan123] [~guozhang] [~bbejeck] > 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)