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

Hang in KafkaConsumer shutdown when close() is not called #3127

Closed
4 of 7 tasks
gridaphobe opened this issue Oct 30, 2020 · 1 comment · Fixed by #3135
Closed
4 of 7 tasks

Hang in KafkaConsumer shutdown when close() is not called #3127

gridaphobe opened this issue Oct 30, 2020 · 1 comment · Fixed by #3135

Comments

@gridaphobe
Copy link
Contributor

gridaphobe commented Oct 30, 2020

Read the FAQ first: https://github.com/edenhill/librdkafka/wiki/FAQ

Description

I've observed a new hang in the C++ KafkaConsumer in v1.5.2 when shutting down without calling close() explicitly. I believe this is related to the recent change to call rd_kafka_destroy() in the dtor. TSAN also occasionally detects a data race between rd_kafka_toppar_op_serve and rd_kafka_fetch_reply_handle on the rktp_last_error field of a toppar while shutting down this consumer.

How to reproduce

See https://gist.github.com/gridaphobe/a2f20726171eb957358bd2a91123015f for a small example, with debug logs, and the output of TSAN.

IMPORTANT: Always try to reproduce the issue on the latest released version (see https://github.com/edenhill/librdkafka/releases), if it can't be reproduced on the latest version the issue has been fixed.

Checklist

IMPORTANT: We will close issues where the checklist has not been completed.

Please provide the following information:

@gridaphobe
Copy link
Contributor Author

I've updated the gist with line numbers in the TSAN output. It looks like the detected data race is not on the refcnt itself, but on the rktp_last_error field of the toppar.

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.

1 participant