Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make rd_kafka_destroy a safe foreign call
- It blocks until everything is being destroyed - It might trigger callbacks Documentation from librdkafka: ``` /** * @brief Destroy Kafka handle. * * @remark This is a blocking operation. * @remark rd_kafka_consumer_close() will be called from this function * if the instance type is RD_KAFKA_CONSUMER, a \c group.id was * configured, and the rd_kafka_consumer_close() was not * explicitly called by the application. This in turn may * trigger consumer callbacks, such as rebalance_cb. * Use rd_kafka_destroy_flags() with * RD_KAFKA_DESTROY_F_NO_CONSUMER_CLOSE to avoid this behaviour. * * @sa rd_kafka_destroy_flags() */ RD_EXPORT void rd_kafka_destroy(rd_kafka_t *rk); ```
- Loading branch information
94a2898
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexbiehl I have started experiencing a strange problem: some of my jobs would hang on closing kafka consumers. Not often, but sometimes.
Do you think that it could be related to this change?
It is a bit puzzling to be because we don't pass anything heap-allocated into that function, but it also that weird destroy function that is being attached, could it be that GH plays some role in this hangs?
94a2898
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
94a2898
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexbiehl @shlevy to be honest, I don't really know if the patch is responsible, I just don't remember seeing this problem before. I will need to dig into stats to see if it was indeed happening earlier...