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

ASF GitHub Bot commented on KAFKA-7604:
---------------------------------------

hachikuji opened a new pull request #5889: KAFKA-7604; Fix flaky unit test 
`testRebalanceAfterTopicUnavailableWithPatternSubscribe``
URL: https://github.com/apache/kafka/pull/5889
 
 
   The problem is the concurrent metadata updates in the foreground and in the 
heartbeat thread. I changed the code to use `ConsumerNetworkClient.poll`, which 
enforces mutual exclusion when accessing the underlying client. I was seeing a 
failure rate of about 1/250 before this fix and I was not able to reproduce it 
with the fix.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Flaky Test 
> `ConsumerCoordinatorTest.testRebalanceAfterTopicUnavailableWithPatternSubscribe`
> -------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-7604
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7604
>             Project: Kafka
>          Issue Type: Bug
>          Components: unit tests
>            Reporter: Jason Gustafson
>            Assignee: Jason Gustafson
>            Priority: Major
>
> {code}
> java.lang.AssertionError: Metadata refresh requested unnecessarily
>       at org.junit.Assert.fail(Assert.java:88)
>       at org.junit.Assert.assertTrue(Assert.java:41)
>       at org.junit.Assert.assertFalse(Assert.java:64)
>       at 
> org.apache.kafka.clients.consumer.internals.ConsumerCoordinatorTest.unavailableTopicTest(ConsumerCoordinatorTest.java:1034)
>       at 
> org.apache.kafka.clients.consumer.internals.ConsumerCoordinatorTest.testRebalanceAfterTopicUnavailableWithPatternSubscribe(ConsumerCoordinatorTest.java:984)
> {code}
> The problem seems to be a race condition in the test case with the heartbeat 
> thread and the foreground thread unsafely attempting to update metadata at 
> the same time.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to