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

Matthias J. Sax commented on KAFKA-7996:
----------------------------------------

> As the current behavior does not conform to this it should be corrected, not 
>"improved".

Sure. But if it would require a public API change (as proposed on the PR), we 
still need a KIP, even for a bug-fix (from my understanding).

Thanks a lot for the detailed analysis. I did not think about the details yet. 
I tend to agree with 
{quote}From a "user" perspective, if something is called a timeout then the 
expectation is that whatever is called returns a response no later than the 
given timeout.
{quote}
If we put into account that
{quote} the total time to close can be much longer anyway because of the 
sequential handling
{quote}
We might want to consider the following:
 * all default timeouts should be set to "MAX_VALUE"
 * if we get a timeout in `KafkaStreams#close()` we split it up for all parts. 
Ie, we get a "start timestamp" and subtract the used time so far to compute the 
"remaining timeout" for the next call. This way, we can make sure that the 
overall timeout is met.

However, I am frankly not sure what the impact to such an implementation might 
be.

What I still don't understand (or maybe I miss read the comment), why does 
"KafkaStreams#close()" not return after the specified timeout? As you mentioned 
correctly, we use a background thread for the actual shutdown calls and thus 
`close()` should respect the provided timeout.

> 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)

Reply via email to