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

ClusterMetadata, update_metadata(...) always fails when following request_update() call #1055

Closed
jackgene opened this issue Oct 12, 2024 · 2 comments · Fixed by #1056
Closed

Comments

@jackgene
Copy link
Contributor

Describe the bug
On ClusterMetadata, an update_metadata(...) call following a request_update() call always fails.

This is because update_metadata(...) is calling:

Both of which do not exist.

Expected behaviour
The correct concurrent.futures.Future API is used, and no exception is thrown.

Environment (please complete the following information):

  • aiokafka version: 0.11.0
  • Kafka Broker version: N/A (not a Kafka issue)
  • Other information: N/A

Reproducible example

    cluster = ClusterMetadata()
    updated_cluster = cluster.request_update()
    # This always fails:
    cluster.update_metadata(
        MetadataResponse[0]([(0, "foo", 12), (1, "bar", 34)], []),
    )
@ods
Copy link
Collaborator

ods commented Oct 21, 2024

Hi @jackgene, thank you for the contribution! You're right, something weird is here, but it doesn't look as simple as in your PR. How did you get this error? I don't see any place where request_update() is called, so self._future should be always None.

@ods ods closed this as completed in #1056 Oct 21, 2024
@jackgene
Copy link
Contributor Author

Hi @jackgene, thank you for the contribution! You're right, something weird is here, but it doesn't look as simple as in your PR. How did you get this error? I don't see any place where request_update() is called, so self._future should be always None.

Yeah, I don't think it's called within the library. I think it's just something that could potentially happen if a client calls request_update(). I discovered these two weird future calls as they were flagged by Pyright during type checking.

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 a pull request may close this issue.

2 participants