chenhongluo edited a comment on pull request #9671:
URL: https://github.com/apache/kafka/pull/9671#issuecomment-1018210592


   We had the same problem with the 0.10.2 client. The findCoordinatorFuture 
was not being cleared, which resulted in a ”coordinator not available“ error 
for every commitOffsetAsync call. We use consumer.assign() to consume. What I 
can't understand is that both lookupCoordinator() and 
clearFindCoordinatorFuture() use synchronized which means 
clearFindCoordinatorFuture() only can execute after lookupCoordinator() are 
completed. Now I want to reproduce this bug, is there any good idea?
   
   There are code:
   
   ```
   protected synchronized RequestFuture<Void> lookupCoordinator() {
           if (findCoordinatorFuture == null) {
               // find a node to ask about the coordinator
               Node node = this.client.leastLoadedNode();
               if (node == null) {
                   // TODO: If there are no brokers left, perhaps we should use 
the bootstrap set
                   // from configuration?
                   log.warn("No broker available to send GroupCoordinator 
request for group {}", groupId);
                   return RequestFuture.noBrokersAvailable();
               } else {
                   findCoordinatorFuture= sendGroupCoordinatorRequest(node);
               }
           }
           return findCoordinatorFuture;
       }
     private synchronized void clearFindCoordinatorFuture() {
           findCoordinatorFuture = null;
       }
   ```
   
     


-- 
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