You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "TengYao Chi (Jira)" <ji...@apache.org> on 2024/09/30 07:16:00 UTC
[jira] [Comment Edited] (KAFKA-17560) testCurrentLag flaky if enabled for new consumer
[ https://issues.apache.org/jira/browse/KAFKA-17560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17885816#comment-17885816 ]
TengYao Chi edited comment on KAFKA-17560 at 9/30/24 7:15 AM:
--------------------------------------------------------------
This issue is fixed in [https://github.com/apache/kafka/pull/16982|https://github.com/apache/kafka/pull/16982#event-14419450603]
was (Author: JIRAUSER305181):
This issue is fixed in https://github.com/apache/kafka/pull/16982#event-14419450603
> testCurrentLag flaky if enabled for new consumer
> ------------------------------------------------
>
> Key: KAFKA-17560
> URL: https://issues.apache.org/jira/browse/KAFKA-17560
> Project: Kafka
> Issue Type: Task
> Components: clients, consumer
> Reporter: Lianet Magrans
> Assignee: TengYao Chi
> Priority: Minor
> Labels: consumer, consumer-threading-refactor
>
> There was an initial attempt to enable testCurrentLag for the new consumer with [https://github.com/apache/kafka/pull/16982.] Even though it included several changes addressing flakiness, it seems not enough, given that the test is still flaky when running for the new consumer. Fails with:
>
> org.opentest4j.AssertionFailedError:
> Expected :OptionalLong[40]
> Actual :OptionalLong.empty
> <Click to see difference>
> at org.apache.kafka.clients.consumer.KafkaConsumerTest.testCurrentLag(KafkaConsumerTest.java:2529)
>
> I wonder if this flakiness is because after receiving a response to a list offset request, maybe a single call to currentLag may not be enough (offsets received in the response not updated yet in the background). Note that after receiving a response to the ListOffsets request, the test moves right away into a single call to currentLag that it expects to be 40, but in the background we only update the subscription state when we get to:
> [https://github.com/apache/kafka/blob/aaf3fc05f8e7cb6b8c79f8471f68faa3a994e1e5/clients/src/main/java/org/apache/kafka/clients/consumer/internals/OffsetsRequestManager.java#L565]
>
> So we could end up with that single call to currentLag not finding the endOffsets we got in the response (it will find them "eventually" with the new consumer I expect)
>
> We should review this test to be able to enable it for the new consumer without flakiness.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)