chenyulin0719 opened a new pull request, #17490: URL: https://github.com/apache/kafka/pull/17490
The error `org.apache.kafka.common.errors.InvalidRequestException: MemberId can't be empty.` was caused by racing between the `first consumer group heartbeat` and the `leave consumer group heartbeat`. This PR checks for the existence of `memberId` before calling `unsubscribe()`, ensuring that there is no leave group heartbeat with an empty memberId. Tested it for 1000 loops in my local environment without any error. (Before this PR, it will fail within 50 loops.) ### 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