You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Brian Byrne (Jira)" <ji...@apache.org> on 2020/02/10 17:23:00 UTC

[jira] [Resolved] (KAFKA-8623) KafkaProducer possible deadlock when sending to different topics

     [ https://issues.apache.org/jira/browse/KAFKA-8623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Byrne resolved KAFKA-8623.
--------------------------------
    Fix Version/s: 2.3.0
       Resolution: Fixed

This appears to be due to an issue concerning the handling of consecutive metadata updates in clients, where the first update could effectively clear the request for the second because no version/instance which request was outstanding was maintained. This was fixed in PR [6621|https://github.com/apache/kafka/pull/6221] (see item 3), which is available in the 2.3.0 release.

> KafkaProducer possible deadlock when sending to different topics
> ----------------------------------------------------------------
>
>                 Key: KAFKA-8623
>                 URL: https://issues.apache.org/jira/browse/KAFKA-8623
>             Project: Kafka
>          Issue Type: Bug
>          Components: producer 
>    Affects Versions: 2.2.1
>            Reporter: Alexander Bagiev
>            Assignee: Kun Song
>            Priority: Critical
>             Fix For: 2.3.0
>
>
> Project with bug reproduction: [https://github.com/abagiev/kafka-producer-bug]
> It was found that sending two messages in two different topics in a row results in hanging of KafkaProducer for 60s and the following exception:
> {noformat}
> org.springframework.kafka.core.KafkaProducerException: Failed to send; nested exception is org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
> 	at org.springframework.kafka.core.KafkaTemplate.lambda$buildCallback$0(KafkaTemplate.java:405) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]
> 	at org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:877) ~[kafka-clients-2.0.1.jar:na]
> 	at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:803) ~[kafka-clients-2.0.1.jar:na]
> 	at org.springframework.kafka.core.DefaultKafkaProducerFactory$CloseSafeProducer.send(DefaultKafkaProducerFactory.java:444) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]
> 	at org.springframework.kafka.core.KafkaTemplate.doSend(KafkaTemplate.java:381) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]
> 	at org.springframework.kafka.core.KafkaTemplate.send(KafkaTemplate.java:193) ~[spring-kafka-2.2.7.RELEASE.jar:2.2.7.RELEASE]
> ...
> {noformat}
> It looks like KafkaProducer requests two times for meta information for each topic and hangs just before second request due to some deadlock. When 60s pass TimeoutException is thrown and meta information is requested/received immediately (but after exception has been already thrown).
> The issue in the example project is reproduced every time; and the use case is trivial.
>  This is a critical bug for us.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)