You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Martin Vysny (JIRA)" <ji...@apache.org> on 2018/06/21 11:03:00 UTC

[jira] [Created] (KAFKA-7085) Producer hangs on TimeoutException: Failed to update metadata after 60000 ms.

Martin Vysny created KAFKA-7085:
-----------------------------------

             Summary: Producer hangs on TimeoutException: Failed to update metadata after 60000 ms.
                 Key: KAFKA-7085
                 URL: https://issues.apache.org/jira/browse/KAFKA-7085
             Project: Kafka
          Issue Type: Bug
          Components: clients
    Affects Versions: 1.1.0
            Reporter: Martin Vysny


I start Kafka in Docker:

docker run --rm -d -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST="127.0.0.1" spotify/kafka

 

Then, I connect KafkaProducer to that Kafka (127.0.0.1:9092) and immediately I call producer.send() . The send() method always blocks for 60s and then fails and callback receives TimeoutException. The producer is therefore unable to send any message which renders it useless.

A workaround is to sleep for 1-2 seconds after the Producer is constructed and before first send() is invoked - that apparently gives enough time to Kafka to synchronize whatever it needs and no longer block endlessly in send()



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)