confluentinc / kafka-rest

Confluent REST Proxy for Kafka
https://docs.confluent.io/current/kafka-rest/docs/index.html
Other
2.25k stars 641 forks source link

KREST-2300 Deflake KafkaConsumerManagerTest.testBackoffMsControlsPollCalls test #1235

Closed trnguyencflt closed 5 months ago

trnguyencflt commented 6 months ago

This PR fixes the logic in KafkaConsumerManager class in the way it handles consumer backoff for readRecords

The approach that KafkaConsumerManager uses to execute backoff RunnableReadTask is:

However, the implementation has flaws:

Combining the two flaws above, we can now explain why the test is flaky (to be fair, the test is correct, it is implementation's issue)

This PR fixes the above flaws by ensuring that:

trnguyencflt commented 5 months ago

Jenkins failed due to unrelated issue, proceed to merge.