Skip to content
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

Dont wakeup during maybe_refresh_metadata -- it is only called by poll() #1769

Merged
merged 1 commit into from
Mar 31, 2019

Conversation

dpkp
Copy link
Owner

@dpkp dpkp commented Mar 30, 2019

This is a simplification of #1765 , intended to address / fix #1760 . The underlying issue here is that if the wakeup socket is full, and so will block on writes, we don't want anything within the poll() method to attempt to write to this socket. This PR updates _maybe_refresh_metadata() to not use wakeups. Because this method is only ever called within poll(), I have made the default wakeup=False. In the future, if the method were invoked from outside / another thread, we would want to pass wakeup=True.


This change is Reviewable

@dpkp dpkp merged commit b1effa2 into master Mar 31, 2019
@dpkp dpkp deleted the maybe_refresh_metadata_no_wakeup branch March 31, 2019 02:29
@jeffwidman
Copy link
Collaborator

In the future, if the method were invoked from outside / another thread, we would want to pass wakeup=True.

Do you want to document that with an inline code comment?

@braedon
Copy link
Contributor

braedon commented Apr 2, 2019

This fix seems to work for me - I haven't been able to reproduce #1760 with it. 🤞

Thanks for all your work on this @dpkp!

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

Successfully merging this pull request may close these issues.

[1.4.5] KafkaProducer raises KafkaTimeoutError when attempting wakeup()
3 participants