dingshuangxi888 opened a new issue, #11668: URL: https://github.com/apache/rocketmq/issues/11668
### Before Creating the Bug Report - [x] I found a bug, not just asking a question, which should be created in [GitHub Discussions](https://github.com/apache/rocketmq/discussions). - [x] I have searched the [GitHub Issues](https://github.com/apache/rocketmq/issues) and [GitHub Discussions](https://github.com/apache/rocketmq/discussions) of this repository and believe that this is not a duplicate. - [x] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ. ### Runtime platform environment Linux, using the Java Remoting and Proxy test fixtures. ### RocketMQ version Apache RocketMQ develop at 19352a24679337276e041f67307c6d284dd48de9. ### JDK Version OpenJDK 11. ### Describe the Bug In cluster mode, ClusterConsumerManager broadcasts an explicit unregister before checking whether the member was removed. The disconnect and expiry paths remove members without going through that method. A peer Proxy can therefore keep a disconnected consumer in its group view until its own expiry scan runs. ### Steps to Reproduce 1. Register a local consumer with ClusterConsumerManager, capture the messages sent by HeartbeatSyncer, then close its Remoting channel. Repeat with a fresh consumer whose last heartbeat has expired and call scanNotActiveChannel(). 2. Separately, register a consumer and call unregisterConsumer twice for the same group and channel. Count the outgoing unregister messages. 3. To exercise the race, pause an expiry scan after it reads the expired member. Explicitly unregister that member, resume the scan, and count local CLIENT_UNREGISTER callbacks. ### What Did You Expect to See? Each actual local removal should trigger one CLIENT_UNREGISTER callback and one unregister broadcast attempt for that group. Repeating an unregister after the member is gone should have no effect. A Proxy receiving a remote unregister should clean up its remote membership without forwarding the event. ### What Did You See Instead? Disconnect and expiry remove the member locally without submitting an unregister broadcast. Repeating an explicit unregister submits another broadcast even though the member is already gone. In the scan/unregister race, the local listener receives two callbacks for the same removal. ### Additional Context _No response_ -- 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]
