RivenSun2 commented on PR #12048:
URL: https://github.com/apache/kafka/pull/12048#issuecomment-1099693054

   Hi @guozhangwang yes i understand what you mean.
   
   `// Remove closed channels after all their buffered receives have been 
processed or if a send was requested
           for (Iterator<Map.Entry<String, KafkaChannel>> it = 
closingChannels.entrySet().iterator(); it.hasNext(); ) {
               KafkaChannel channel = it.next().getValue();
               boolean sendFailed = failedSends.remove(channel.id());
               boolean hasPending = false;
               if (!sendFailed)
                   hasPending = maybeReadFromClosingChannel(channel);
               if (!hasPending || sendFailed) {
                   doClose(channel, true);
                   it.remove();
               }`
               
   You can browse this whole block of code, and you will find that `if 
(!hasPending || sendFailed)` is equivalent to `if (!hasPending)`. Condition 
'sendFailed' is always 'false' when reached.
    WDYT?
    Thanks.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to