-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fixes KafkaAdminClient returning IncompatibleBrokerVersion
when passing an api_version
#1953
Conversation
Passing an `api_version` to KafkaAdminClient always raises `IncompatibleBrokerVersion` line 240 Found that this is because `broker_api_versions = self._client.get_api_versions()` always returns None apparently because `check_version` had not been called previously. Per the note from `get_api_versions()`, > A call to check_version must previously have succeeded and returned
`self._client.check_version()` only needs to be called once for `self._client.get_api_versions()` to work in `def _matching_api_version`
Could someone review this PR? |
@jeffwidman sorry to @ you here but I'm hoping if you would be able to review this? |
I learned that the following code, which set Reproduce steps
Expected resultCreate the topic without exception
Actual resultReproducibility: always
Additional information
|
@dpkp requesting for a review pls? |
check_version()
before get_api_versions()
IncompatibleBrokerVersion
when passing an api_version
I think this is fine, though I wonder why you would want to pass |
tbh, not really sure why there is a need to pass the I guess users use the resulting Anyhow, thanks for the review and merge! much appreciated 🙇 |
It's useful for:
cc @dpkp |
I get the same problem that this PR aims to fix. In my case I'm setting the version to avoid auto discovery, which fails in the CI test runner but work on my computer probably due to some network differences. I think it's the problem shown here: #1308 |
If you're hitting a problem, please open a new ticket. Also, can you make sure you're using the recently released 2.0 version? |
Good to know, I didn't notice the new version. Turns out there was a configuration error and the problem isn;t in the library :) |
What does this PR do?
Fixes KafkaAdminClient always returning
IncompatibleBrokerVersion
when passing anapi_version
.This will calls
check_version()
on init beforeget_api_versions()
get called by_matching_api_version
.Passing an
api_version
toKafkaAdminClient
seem to always raiseIncompatibleBrokerVersion
line 240Found that this is because
broker_api_versions = self._client.get_api_versions()
always returns None apparently becausecheck_version()
had not been called previously.Per the note from
get_api_versions()
,This change is