Skip to content

After producer is closed, send() results in timeout error #2060

@MrCreosote

Description

@MrCreosote
In [1]: import kafka                                                            

In [2]: kafka.__version__                                                       
Out[2]: '2.0.1'

In [3]: from kafka import KafkaProducer                                         

In [4]: port = 49163                                                            

In [5]: kp = KafkaProducer(bootstrap_servers=f'localhost:{port}', acks='all', re
   ...: tries=300, retry_backoff_ms=30000, max_in_flight_requests_per_connection
   ...: =1)                                                                     

In [6]: kp.close()                                                              

In [7]: kp.send('tpc', b'hiya')                                                 
*snip*

KafkaTimeoutError: KafkaTimeoutError: Failed to update metadata after 60.0 secs.

Minor-ish, but confusing for a newbie. I'd expect an immediate 'Knock it off, I'm closed' error or something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions