hachikuji commented on a change in pull request #9958: URL: https://github.com/apache/kafka/pull/9958#discussion_r583102652
########## File path: core/src/main/scala/kafka/coordinator/group/GroupMetadata.scala ########## @@ -247,16 +250,20 @@ private[group] class GroupMetadata(val groupId: String, initialState: GroupState if (leaderId.isEmpty) leaderId = Some(member.memberId) + members.put(member.memberId, member) - member.supportedProtocols.foreach{ case (protocol, _) => supportedProtocols(protocol) += 1 } + member.supportedProtocols.foreach { case (protocol, _) => supportedProtocols(protocol) += 1 } member.awaitingJoinCallback = callback + if (member.isAwaitingJoin) numMembersAwaitingJoin += 1 + + pendingMembers.remove(member.memberId) } def remove(memberId: String): Unit = { members.remove(memberId).foreach { member => - member.supportedProtocols.foreach{ case (protocol, _) => supportedProtocols(protocol) -= 1 } + member.supportedProtocols.foreach { case (protocol, _) => supportedProtocols(protocol) -= 1 } Review comment: Yeah, I agree. I tried a few options for this, but I could not find one I felt satisfied with. If you have a good suggestion, I'm happy to give it a shot here or review if you want to do a separate PR. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org