Skip to content

Publishing to an ACL protected topic doesn't propagate TopicAuthorizationFailedError in KafkaProducer._wait_on_metadata #2078

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
mkromer-tc opened this issue Jul 13, 2020 · 1 comment

Comments

@mkromer-tc
Copy link

mkromer-tc commented Jul 13, 2020

In producer/kafka.py in KafkaProducer._wait_on_metadata, if an exception was identified in the future, it is not propagated.

The revised code should probably be something like:

            future = self._metadata.request_update()
            future.add_both(lambda e, *args: e.set(), metadata_event)
            self._sender.wakeup()
            metadata_event.wait(max_wait - elapsed)
            if future.exception:  # Propagate exception
                raise future.exception
@dpkp
Copy link
Owner

dpkp commented Mar 12, 2025

Unclear why this isn't sufficient:

740             elif topic in self._metadata.unauthorized_topics:
741                 raise Errors.TopicAuthorizationFailedError(set([topic]))

@dpkp dpkp closed this as completed Mar 12, 2025
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