Skip to content

Ignore MetadataResponses with empty broker list #1506

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

Merged
merged 3 commits into from
May 26, 2018

Conversation

dpkp
Copy link
Owner

@dpkp dpkp commented May 25, 2018

Fix for #1494 . The MetadataResponse should be ignored and treated as a failure if the broker list is empty (same as the java client).

@dpkp dpkp changed the title Empty broker list metadata Ignore MetadataResponses with empty broker list May 25, 2018
from kafka.cluster import ClusterMetadata
from kafka.protocol.metadata import MetadataResponse

import kafka.common as Errors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is confusing... why import common as Errors? Why not directly import errors as errors or common as common?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch! I removed that line as it is not needed. But generally re: kafka.common -- that line was copy-pasta from a file that was written a long time ago before kafka.common was split into kafka.errors and kafka.structs . The only reason to keep kafka.common is to prevent breaking user code that was written before the change. But for our library code we should use kafka.errors directly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I thought... I finished the library cleanup here: #1509 so hopefully this won't happen again...

Copy link
Contributor

@jeffwidman jeffwidman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dpkp dpkp merged commit ee26c3f into master May 26, 2018
@dpkp dpkp deleted the empty_broker_list_metadata branch May 26, 2018 17:52
88manpreet pushed a commit to Yelp/kafka-python that referenced this pull request Aug 1, 2018
88manpreet pushed a commit to Yelp/kafka-python that referenced this pull request Aug 1, 2018
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.

2 participants