qianye1001 opened a new issue, #11493:
URL: https://github.com/apache/rocketmq/issues/11493

   ### 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
   
   Any platform running RocketMQ Proxy in cluster mode.
   
   ### RocketMQ version
   
   develop
   
   ### JDK Version
   
   Not specific to a JDK version.
   
   ### Describe the Bug
   
   `HeartbeatSyncer.remoteChannelMap` retains a `RemoteChannel` when a proxy 
receives an UNREGISTER heartbeat for a group/channel that is not already 
present in the map.
   
   This is a remaining cleanup path related to #7429. `consumeMessage` 
currently calls `remoteChannelMap.computeIfAbsent` before checking the 
heartbeat type. An unmatched UNREGISTER therefore creates the very entry it 
should remove. Since there is no corresponding registered consumer, 
`ConsumerManager.unregisterConsumer` does not emit `CLIENT_UNREGISTER`, and 
`processConsumerGroupEvent` never removes the new map entry.
   
   ### Steps to Reproduce
   
   1. Deliver an UNREGISTER heartbeat to `HeartbeatSyncer.consumeMessage` for a 
group/channel absent from `remoteChannelMap`.
   2. Observe that `remoteChannelMap` gains an entry even though no REGISTER 
heartbeat was processed.
   3. Observe that no `CLIENT_UNREGISTER` event removes the entry.
   
   ### What Did You Expect to See?
   
   An UNREGISTER heartbeat for an unknown remote channel should be ignored 
without adding anything to `remoteChannelMap`.
   
   ### What Did You See Instead?
   
   The unknown remote channel is inserted into `remoteChannelMap` and can 
remain there indefinitely. Repeated incomplete heartbeat sequences can 
accumulate retained `RemoteChannel` objects after clients have disconnected.
   
   ### Additional Context
   
   The fix should only create/cache a channel for REGISTER heartbeats. 
UNREGISTER should use an existing cached channel and do nothing when none 
exists.


-- 
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