Skip to content

After calling close, consumers issue periodic metadata requests #30

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
aaronhays opened this issue Aug 11, 2016 · 2 comments
Closed

After calling close, consumers issue periodic metadata requests #30

aaronhays opened this issue Aug 11, 2016 · 2 comments

Comments

@aaronhays
Copy link

If you create a consumer, connect, read some data, and then close but don't destroy every reference to the consumer, it will continue issuing metadata requests every five minutes.

I'm assuming this is because you are calling rd_kafka_consumer_close in the python close() method, but not calling rd_kafka_destroy until the consumer object is deallocated. It seems like once you call close(), the Consumer instance cannot be used for anything - is there a reason not to call rd_kafka_destroy in close()?

@edenhill
Copy link
Contributor

Your analysis is correct.
close() "only" closes the high-level consumer functionality (namely leaving the group, committing offsets, etc), but the underlying librdkafka consumer handle remains functional for legacy consumer and basic operations (such as metadata requests!).

Now, there's probably no real use to close the consumer and then do something else on the same handle, so calling rd_kafka_destroy() from close() in the Python API sounds like a good idea.

@edenhill
Copy link
Contributor

Fixed on master.

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