FrankYang0529 opened a new pull request, #18945:
URL: https://github.com/apache/kafka/pull/18945

   There are two thread do poll. One is the main thread, another is the 
AbstractCoordinator#HeartbeatThread.
   
   The heartbeat thread is enabled after AbstractCoordinator receives 
JoinGroupResponse.In this case, we assume the first and second 
`coordinator.poll(time.timer(0))` don't get an active group, so the 
assignedCount is 1.
   
   However, if there is race condition, the joinFuture is completed by 
heartbeat thread. The `coordinator.poll(time.timer(0))` gets an active group 
and AbstractCoordinator#onJoinComplete is called twice, so the assignedCount is 
2.
   
   ### 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 to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to