You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "github-ayio (via GitHub)" <gi...@apache.org> on 2023/05/25 07:11:34 UTC

[GitHub] [rocketmq] github-ayio opened a new issue, #6810: [Bug] Bug title

github-ayio opened a new issue, #6810:
URL: https://github.com/apache/rocketmq/issues/6810

   ### 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 version 3.10.0-1160.49.1.el7.x86_64
   
   
   ### RocketMQ version
   
   broker 4.9.3
   
   ### JDK Version
   
   jdk17
   
   ### Describe the Bug
   
    with the same clientId, the groupChannelTable in ProducerManager has data, but the clientChannelTable does not
   
   ### Steps to Reproduce
   
   send sync message, but no response
   
   
   ### What Did You Expect to See?
   
   response the correct data
   
   ### What Did You See Instead?
   
   Caused by: org.apache.rocketmq.client.exception.MQBrokerException: CODE: 1  DESC: push reply message fail, channel of <XXXXX@599#20869074073> not found. BROKER: XXX:10911
   
   ### 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: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] 920799648 commented on issue #6810: [Bug] with the same clientId, the groupChannelTable in ProducerManager has data, but the clientChannelTable does not

Posted by "920799648 (via GitHub)" <gi...@apache.org>.
920799648 commented on issue #6810:
URL: https://github.com/apache/rocketmq/issues/6810#issuecomment-1587404026

   > ProducerManager's `ConcurrentHashMap<String /* group name */, ConcurrentHashMap<**Channel**, ClientChannelInfo>>`. using Channel as Key to maintain ClientChannelInfo in same group, instead of ClientId.
   > 
   > So If you register different clientId **but same channel**. ProducerManager#registerProducer() will only update the lastUpdateTimestamp. instead of create new ClientChannelInfo for newer ClientId and override old.
   > 
   > ProducerManager中`ConcurrentHashMap<String /* group name */, ConcurrentHashMap<**Channel**, ClientChannelInfo>>`。使用了Channel类作为Key来维护ClientChannelInfo,而不是String类型的ClientId。
   > 
   > 所以,如果注册了两个不同的ClientID,但是**Channel是相同的**话,那么`ProducerManager#registerProducer()`方法将只会更新该Channel的最后更新时间戳,而不是为新注册的ClientID创建一个新的ClientChannelInfo并且覆盖旧的Client。
   
   不好意思,可能之前表达的不是很清楚,同一个channel在groupChannelTable中可以查询到数据,导致不会再塞入clientChannelTable中,只更新时间,实际上clientChannelTable 变量中已经没有这个channel 的数据,导致 调用ProducerManager#findChannel方法提示push reply message fail, channel of <XXXXX@599#20869074073> not found. BROKER: XXX:10911(pushReplyResult.setRemark("push reply message fail, channel of <" + senderId + "> not found."))


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] zd46319 commented on issue #6810: [Bug] with the same clientId, the groupChannelTable in ProducerManager has data, but the clientChannelTable does not

Posted by "zd46319 (via GitHub)" <gi...@apache.org>.
zd46319 commented on issue #6810:
URL: https://github.com/apache/rocketmq/issues/6810#issuecomment-1647147948

   我这边遇到了同样的问题,版本也是4.9.3,broker的日志显示是这样的:
   ```
   2023-07-20 02:14:49 INFO NettyEventExecutor - NETTY EVENT: remove channel[ClientChannelInfo [channel=[id: 0x1d2ea18e, L:/192.168.0.100:10911 ! R:/192.168.0.102:41678], clientId=192.168.0.102@18699#35262262388230038, language=JAVA, version=399, lastUpdateTimestamp=1689790452184]][192.168.0.102:41678] from ProducerManager groupChannelTable, producer group: group-1
   2023-07-20 02:14:49 INFO NettyEventExecutor - NETTY EVENT: remove channel[ClientChannelInfo [channel=[id: 0x1d2ea18e, L:/192.168.0.100:10911 ! R:/192.168.0.102:41678], clientId=192.168.0.102@18699#35262262388230038, language=JAVA, version=399, lastUpdateTimestamp=1689790452184]][192.168.0.102:41678] from ProducerManager groupChannelTable, producer group: CLIENT_INNER_PRODUCER
   2023-07-20 02:14:49 INFO HeartbeatThread_3 - new producer connected, group: CLIENT_INNER_PRODUCER channel: ClientChannelInfo [channel=[id: 0x1d2ea18e, L:/192.168.0.100:10911 ! R:/192.168.0.102:41678], clientId=192.168.0.102@18699#35262262388230038, language=JAVA, version=399, lastUpdateTimestamp=1689790489779]
   2023-07-20 02:14:49 INFO HeartbeatThread_3 - new producer connected, group: group-1 channel: ClientChannelInfo [channel=[id: 0x1d2ea18e, L:/192.168.0.100:10911 ! R:/192.168.0.102:41678], clientId=192.168.0.102@18699#35262262388230038, language=JAVA, version=399, lastUpdateTimestamp=1689790489779]
   2023-07-20 02:15:12 INFO HeartbeatThread_5 - new producer connected, group: CLIENT_INNER_PRODUCER channel: ClientChannelInfo [channel=[id: 0xad11f188, L:/192.168.0.100:10911 - R:/192.168.0.102:47453], clientId=192.168.0.102@18699#35262262388230038, language=JAVA, version=399, lastUpdateTimestamp=1689790512232]
   2023-07-20 02:15:12 INFO HeartbeatThread_5 - new producer connected, group: group-1 channel: ClientChannelInfo [channel=[id: 0xad11f188, L:/192.168.0.100:10911 - R:/192.168.0.102:47453], clientId=192.168.0.102@18699#35262262388230038, language=JAVA, version=399, lastUpdateTimestamp=1689790512232]
   2023-07-20 02:16:59 WARN ClientHousekeepingScheduledThread1 - SCAN: remove expired channel[192.168.0.102:41678] from ProducerManager groupChannelTable, producer group name: group-1
   2023-07-20 02:16:59 WARN ClientHousekeepingScheduledThread1 - SCAN: remove expired channel[192.168.0.102:41678] from ProducerManager groupChannelTable, producer group name: CLIENT_INNER_PRODUCER
   ```
   02:14:49有一次网络抖动,导致“192.168.0.102@18699#35262262388230038”这个**clientId有两个channel连到了broker上**,端口41678和端口47453。导致registerProducer的时候,groupChannelTable有两条数据,clientChannelTable 只有一条。
   之后ProducerManager.scanNotActiveChannel()扫描的时候,扫到了41678端口这个channel,remove的时候顺便把clientChannelTable给清了。之后再通过clientId从clientChannelTable获取的时候就“channel not found”了。
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] yaowenbinqwq commented on issue #6810: [Bug] with the same clientId, the groupChannelTable in ProducerManager has data, but the clientChannelTable does not

Posted by "yaowenbinqwq (via GitHub)" <gi...@apache.org>.
yaowenbinqwq commented on issue #6810:
URL: https://github.com/apache/rocketmq/issues/6810#issuecomment-1583810051

   ProducerManager's  `ConcurrentHashMap<String /* group name */, ConcurrentHashMap<**Channel**, ClientChannelInfo>>`. using Channel as Key to maintain ClientChannelInfo in same group, instead of ClientId.
   
   So If you register different clientId **but same channel**. ProducerManager#registerProducer() will only update the lastUpdateTimestamp. instead of create new ClientChannelInfo for newer ClientId and override old.
   
   ProducerManager中`ConcurrentHashMap<String /* group name */, ConcurrentHashMap<**Channel**, ClientChannelInfo>>`。使用了Channel类作为Key来维护ClientChannelInfo,而不是String类型的ClientId。
   
   所以,如果注册了两个不同的ClientID,但是**Channel是相同的**话,那么`ProducerManager#registerProducer()`方法将只会更新该Channel的最后更新时间戳,而不是为新注册的ClientID创建一个新的ClientChannelInfo并且覆盖旧的Client。


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] 920799648 commented on issue #6810: [Bug] with the same clientId, the groupChannelTable in ProducerManager has data, but the clientChannelTable does not

Posted by "920799648 (via GitHub)" <gi...@apache.org>.
920799648 commented on issue #6810:
URL: https://github.com/apache/rocketmq/issues/6810#issuecomment-1587422290

   > ProducerManager's `ConcurrentHashMap<String /* group name */, ConcurrentHashMap<**Channel**, ClientChannelInfo>>`. using Channel as Key to maintain ClientChannelInfo in same group, instead of ClientId.
   > 
   > So If you register different clientId **but same channel**. ProducerManager#registerProducer() will only update the lastUpdateTimestamp. instead of create new ClientChannelInfo for newer ClientId and override old.
   > 
   > ProducerManager中`ConcurrentHashMap<String /* group name */, ConcurrentHashMap<**Channel**, ClientChannelInfo>>`。使用了Channel类作为Key来维护ClientChannelInfo,而不是String类型的ClientId。
   > 
   > 所以,如果注册了两个不同的ClientID,但是**Channel是相同的**话,那么`ProducerManager#registerProducer()`方法将只会更新该Channel的最后更新时间戳,而不是为新注册的ClientID创建一个新的ClientChannelInfo并且覆盖旧的Client。
   
   ![image](https://github.com/apache/rocketmq/assets/58260416/f0681579-2e6f-4a7b-8e96-1b8a03e0e0db)
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] 920799648 commented on issue #6810: [Bug] with the same clientId, the groupChannelTable in ProducerManager has data, but the clientChannelTable does not

Posted by "920799648 (via GitHub)" <gi...@apache.org>.
920799648 commented on issue #6810:
URL: https://github.com/apache/rocketmq/issues/6810#issuecomment-1587418878

   > 注册了两个不同的ClientID,但是**Channel是相同的**
   
   什么样的情况下会出现两个不同的ClientID,但是Channel是相同的?


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] 920799648 commented on issue #6810: [Bug] with the same clientId, the groupChannelTable in ProducerManager has data, but the clientChannelTable does not

Posted by "920799648 (via GitHub)" <gi...@apache.org>.
920799648 commented on issue #6810:
URL: https://github.com/apache/rocketmq/issues/6810#issuecomment-1587394752

   > 
   ![image](https://github.com/apache/rocketmq/assets/58260416/bbcbf3d7-f25e-4bb5-ba30-808d55deb7d9)
   
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [rocketmq] RongtongJin closed issue #6810: [Bug] with the same clientId, the groupChannelTable in ProducerManager has data, but the clientChannelTable does not

Posted by "RongtongJin (via GitHub)" <gi...@apache.org>.
RongtongJin closed issue #6810: [Bug] with the same clientId, the groupChannelTable in ProducerManager has data, but the clientChannelTable does not
URL: https://github.com/apache/rocketmq/issues/6810


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org