-
Notifications
You must be signed in to change notification settings - Fork 24
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
Kafka consumer leaves group after 5 mins #110
Comments
Motivation: This PR fixes issue swift-server#110. `KakfaConsumer`: by polling the `rd_kafka_queue_get_main` queue instead of the `rd_kafka_queue_get_consumer` queue, the timer for `max.poll.interval.ms` did not get reset which eventually resulted in a timeout despite polling. (See [`librdkafka` documentation](https://docs.confluent.io/platform/current/clients/librdkafka/html/rdkafka_8h.html#acacdb55ae7cb6abfbde89621e512b078)) Modifications: * `RDKafkaClient`: * rename `mainQueue` to `queue` * use `rd_kafka_queue_get_consumer` instead of `rd_kafka_queue_get_main` for `KakfaConsumer` clients -> this will reset the timer for `max.poll.interval.ms` so that the consumer does not time out despite polling * invoke `rd_kafka_queue_destroy(self.queue)` on `RDKafkaClient.deinit` to loose reference to queue
Hello @blindspotbounty , thank you very much for raising this issue and providing the steps to reproduce, this really helped debug this issue and eventually find the fix! (#113) The problem here is that we are using Thanks a lot, Felix |
* Fix: Kafka consumer leaves group after 5 mins Motivation: This PR fixes issue #110. `KakfaConsumer`: by polling the `rd_kafka_queue_get_main` queue instead of the `rd_kafka_queue_get_consumer` queue, the timer for `max.poll.interval.ms` did not get reset which eventually resulted in a timeout despite polling. (See [`librdkafka` documentation](https://docs.confluent.io/platform/current/clients/librdkafka/html/rdkafka_8h.html#acacdb55ae7cb6abfbde89621e512b078)) Modifications: * `RDKafkaClient`: * rename `mainQueue` to `queue` * use `rd_kafka_queue_get_consumer` instead of `rd_kafka_queue_get_main` for `KakfaConsumer` clients -> this will reset the timer for `max.poll.interval.ms` so that the consumer does not time out despite polling * invoke `rd_kafka_queue_destroy(self.queue)` on `RDKafkaClient.deinit` to loose reference to queue * Review blindspot Modifications: * update comment at invocation of `RDKafkaClient.pollSetConsumer` * don't fail softly when `rd_kafka_queue_get_consumer` returns `nil` * don't create new reference to consumer queue in `RDKafkaClient.consumerClose()`
Now works as expected! |
KafkaConsumer stops after 5 mins of consumption with error:
There are two problems:
eventPoll
)How to reproduce
As minimal reproducing snippet I can suggest the following diff to existing test to make sequence big enough
Result of this test is:
That is very similar to confluentinc/confluent-kafka-go#980 but not the same. That bug was fixed in 2.1.1 which is a part of swift kafka gsoc.
The text was updated successfully, but these errors were encountered: