apoorvmittal10 opened a new pull request, #23510: URL: https://github.com/apache/kafka/pull/23510
ShareSessionCache `.remove` and `.maybeCreateSession` are each individually synchronized — but as two separate calls, not one atomic unit. If two connections sent an INITIAL_EPOCH request for the same (groupId, memberId), *faulty client*, at nearly the same time then both proceed to create a session. `maybeCreateSession` increments numMembersPerGroup and numPartitions every time it's called. The sessions map only ever holds one entry per key (second write overwrites the first), but the counters had already been bumped twice. on disconnect, only the connection whose mapping still pointed at a live session gets to decrement the counters. So numMembersPerGroup for that group gets stuck above zero forever, which means onGroupEmpty never fires. -- 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]
