[ 
https://issues.apache.org/jira/browse/KAFKA-17623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17912680#comment-17912680
 ] 

Kirk True commented on KAFKA-17623:
-----------------------------------

The test creates a {{Consumer}} that subscribes to a topic named {{topic}} with 
two partitions. In the common case, {{onPartitionsAssigned()}} is invoked once 
by the consumer with a list that contains both partitions:

{quote}
[topic-0, topic-1]
{quote}

However, in rare cases, {{onPartitionsAssigned()}} is invoked with a list that 
contains a single topic succession:

{quote}
[topic-1]
{quote}

or

{quote}
[topic-0]
{quote}

In these cases, the {{onPartitionsAssigned()}} will be invoked twice, but the 
ordering of the partitions in those invocations is (or at least should be) 
considered non-deterministic. The test assumes that the consumer is assigned 
_both_ test partitions at the same time, but in the rare case the rebalance 
callback receives a call with just {{topic-1}}. What that happens, because the 
test invokes various {{Consumer}} APIs with the {{topic-0}} partition, an error 
is thrown because that partition is not (yet) assigned.

> Flaky 
> testSeekPositionAndPauseNewlyAssignedPartitionOnPartitionsAssignedCallback
> --------------------------------------------------------------------------------
>
>                 Key: KAFKA-17623
>                 URL: https://issues.apache.org/jira/browse/KAFKA-17623
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients, consumer
>            Reporter: Lianet Magrans
>            Assignee: Kirk True
>            Priority: Blocker
>              Labels: consumer-threading-refactor, flaky-test, integration-test
>             Fix For: 4.0.0
>
>
> Flaky for the new consumer, failing with :
> org.apache.kafka.common.KafkaException: User rebalance callback throws an 
> error at 
> app//org.apache.kafka.clients.consumer.internals.ConsumerUtils.maybeWrapAsKafkaException(ConsumerUtils.java:259)
>  at 
> app//org.apache.kafka.clients.consumer.internals.AsyncKafkaConsumer.invokeRebalanceCallbacks(AsyncKafkaConsumer.java:1867)
>  at 
> app//org.apache.kafka.clients.consumer.internals.AsyncKafkaConsumer$BackgroundEventProcessor.process(AsyncKafkaConsumer.java:195)
>  at 
> app//org.apache.kafka.clients.consumer.internals.AsyncKafkaConsumer$BackgroundEventProcessor.process(AsyncKafkaConsumer.java:181)
>  at 
> app//org.apache.kafka.clients.consumer.internals.AsyncKafkaConsumer.processBackgroundEvents(AsyncKafkaConsumer.java:1758)
>  at 
> app//org.apache.kafka.clients.consumer.internals.AsyncKafkaConsumer.updateAssignmentMetadataIfNeeded(AsyncKafkaConsumer.java:1618)
> ...
> Caused by: java.lang.IllegalStateException: No current assignment for 
> partition topic-0 at 
> org.apache.kafka.clients.consumer.internals.SubscriptionState.assignedState(SubscriptionState.java:378)
>  at 
> org.apache.kafka.clients.consumer.internals.SubscriptionState.seekUnvalidated(SubscriptionState.java:395)
>  at 
> org.apache.kafka.clients.consumer.internals.events.ApplicationEventProcessor.process(ApplicationEventProcessor.java:425)
>  at 
> org.apache.kafka.clients.consumer.internals.events.ApplicationEventProcessor.process(ApplicationEventProcessor.java:147)
>  at 
> org.apache.kafka.clients.consumer.internals.ConsumerNetworkThread.processApplicationEvents(ConsumerNetworkThread.java:171)
>  
> Flaky behaviour:
>  
> https://ge.apache.org/scans/tests?search.buildOutcome=failure&search.names=Git%20branch&search.rootProjectNames=kafka&search.startTimeMax=1727409599999&search.startTimeMin=1722484800000&search.timeZoneId=America%2FToronto&search.values=trunk&tests.container=integration.kafka.api.PlaintextConsumerCallbackTest&tests.test=testSeekPositionAndPauseNewlyAssignedPartitionOnPartitionsAssignedCallback(String%2C%20String)%5B3%5D



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to