confluent-kafka-python
confluent-kafka-python copied to clipboard
Implement `timeout` option for `seek`
Description
Here the timeout option is hardcoded as -1 and not surfaced to the Python API. https://github.com/confluentinc/confluent-kafka-python/blob/e671bccb8a4f98302748ccf60d5d579f68c6613d/src/confluent_kafka/src/Consumer.c#L817
Would be great to be able to set timeout in this API. https://docs.confluent.io/2.0.0/clients/librdkafka/rdkafka_8h.html#a6667b162931982e9827e3d86ad22ec7d
How to reproduce
Checklist
Please provide the following information:
- [ ] confluent-kafka-python and librdkafka version (
confluent_kafka.version()andconfluent_kafka.libversion()): - [ ] Apache Kafka broker version:
- [ ] Client configuration:
{...} - [ ] Operating system:
- [ ] Provide client logs (with
'debug': '..'as necessary) - [ ] Provide broker log excerpts
- [ ] Critical issue
Out of curiosity; are you seeing seek() blocking for more than a couple of milliseconds?
Out of curiosity; are you seeing seek() blocking for more than a couple of milliseconds?
Oh wow, actually I assumed that -1 meant async but 0 means async and -1 means blocking without timeout.
Then there is another reason that my seek() calls sometimes take a while to materialize.
So, to answer your question, the seek() calls are always really quick (so quick that I don't need the timeout setting implemented), but sometimes they seem to not have any effect for some time.