Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MrCreosote opened this issue May 30, 2020 · 0 comments
Closed

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

MrCreosote opened this issue May 30, 2020 · 0 comments

Comments

@MrCreosote
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants