You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/12/21 09:34:07 UTC

[GitHub] [rocketmq-client-go] WJL3333 opened a new issue #759: Master code reset consumer offset cause program exit

WJL3333 opened a new issue #759:
URL: https://github.com/apache/rocketmq-client-go/issues/759


   1. Please describe the issue you observed:
       1. start local RocketMQ cluster 
       2. use example/consumer/simple/main.go start a consumer.
       3. use ./mqadmin resetOffset tool to reset offset.
       4. consumer process exit with.
       ```shell
             INFO[0005] receive reset consumer offset request...      broker="127.0.0.1:30931" consumerGroup=groupB timestamp=631123200000 topic=topicB
   panic: runtime error: index out of range [1] with length 1
   
   goroutine 113 [running]:
   github.com/apache/rocketmq-client-go/v2/internal.(*ResetOffsetBody).Decode(0xc000461d20, {0xc00040c100, 0xfd, 0xfd})
           /Users/bytedance/github/rocketmq-client-go/internal/model.go:309 +0xa45
   github.com/apache/rocketmq-client-go/v2/internal.GetOrNewRocketMQClient.func5(0xc000416a80, {0x14ed5c8, 0xc0003260c0})
           /Users/bytedance/github/rocketmq-client-go/internal/client.go:303 +0x3f8
   github.com/apache/rocketmq-client-go/v2/internal/remote.(*remotingClient).processCMD.func2()
           /Users/bytedance/github/rocketmq-client-go/internal/remote/remote_client.go:207 +0x94
   github.com/apache/rocketmq-client-go/v2/primitive.WithRecover(0xc000421ef0)
           /Users/bytedance/github/rocketmq-client-go/primitive/base.go:100 +0x47
   created by github.com/apache/rocketmq-client-go/v2/internal/remote.(*remotingClient).processCMD
           /Users/bytedance/github/rocketmq-client-go/internal/remote/remote_client.go:206 +0x378
   Exiting.
   
       ```
   2. Please tell us about your environment:
       mac local 
       master client-go code.
       rocketmq broker with fastjson-1.2.76.jar
   
   3. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):
   the test code in decode ResetOffsetBody json format is different from mine
   
   mine from rocketmq broker response rpc
   ```json
   {"offsetTable":{{"brokerName":"RaftNode00","queueId":0,"topic":"topicB"}:0,{"brokerName":"RaftNode00","queueId":1,"topic":"topicB"}:0,{"brokerName":"RaftNode00","queueId":2,"topic":"topicB"}:0,{"brokerName":"RaftNode00","queueId":3,"topic":"topicB"}:0}}
   ```
   
   any different from fastjson config ?
   


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

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



[GitHub] [rocketmq-client-go] WJL3333 commented on issue #759: Master code reset consumer offset cause program exit

Posted by GitBox <gi...@apache.org>.
WJL3333 commented on issue #759:
URL: https://github.com/apache/rocketmq-client-go/issues/759#issuecomment-998622301


   more context: see https://github.com/apache/rocketmq-client-go/blob/82dcf51c7c9bcec25a29e9617da61089db44b16d/internal/model_test.go#L407-L422


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

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



[GitHub] [rocketmq-client-go] maixiaohai commented on issue #759: Master code reset consumer offset cause program exit

Posted by GitBox <gi...@apache.org>.
maixiaohai commented on issue #759:
URL: https://github.com/apache/rocketmq-client-go/issues/759#issuecomment-1000990256


   > @maixiaohai hello,can you check this problem. i think the json is not the same cause the parse problem. what is your fastjson version
   
   We use Gson internal, can you help fix this?


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

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



[GitHub] [rocketmq-client-go] wenfengwang commented on issue #759: Master code reset consumer offset cause program exit

Posted by GitBox <gi...@apache.org>.
wenfengwang commented on issue #759:
URL: https://github.com/apache/rocketmq-client-go/issues/759#issuecomment-1000450087


   @WJL3333 Thanks for your report, Could you have any idea for fixing this?


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

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



[GitHub] [rocketmq-client-go] maixiaohai commented on issue #759: Master code reset consumer offset cause program exit

Posted by GitBox <gi...@apache.org>.
maixiaohai commented on issue #759:
URL: https://github.com/apache/rocketmq-client-go/issues/759#issuecomment-1001103482


   > yes, but should we just follow the fastjson schema, and change the origin gson format? @maixiaohai @wenfengwang
   
   Yeah, fastjson format is original currently. RMQ server use fastjson to encode and decode as default. 
   And Fastjson has security problem and produce some non-standard json schema. Only change the client schema can not solve this problem. 
   This is a related issue to describe the background https://github.com/apache/rocketmq/issues/2462.


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

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



[GitHub] [rocketmq-client-go] WJL3333 commented on issue #759: Master code reset consumer offset cause program exit

Posted by GitBox <gi...@apache.org>.
WJL3333 commented on issue #759:
URL: https://github.com/apache/rocketmq-client-go/issues/759#issuecomment-1001101893


   yes, but should we just follow the fastjson schema, and change the origin gson format? @maixiaohai @wenfengwang 


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

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



[GitHub] [rocketmq-client-go] WJL3333 commented on issue #759: Master code reset consumer offset cause program exit

Posted by GitBox <gi...@apache.org>.
WJL3333 commented on issue #759:
URL: https://github.com/apache/rocketmq-client-go/issues/759#issuecomment-998619851


   @maixiaohai hello,can you check this problem. i think the json is not the same cause the parse problem. what is your fastjson version
   


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

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



[GitHub] [rocketmq-client-go] WJL3333 commented on issue #759: Master code reset consumer offset cause program exit

Posted by GitBox <gi...@apache.org>.
WJL3333 commented on issue #759:
URL: https://github.com/apache/rocketmq-client-go/issues/759#issuecomment-1001104075


   yes, i agree with you. the non-standard json schema is very annoying when port some admin interface from java to go.
   and for this case. i will try to parse response json first. if we found this is non-standard json schema. the code will try to parse response as fastjson format. 


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

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



[GitHub] [rocketmq-client-go] WJL3333 commented on issue #759: Master code reset consumer offset cause program exit

Posted by GitBox <gi...@apache.org>.
WJL3333 commented on issue #759:
URL: https://github.com/apache/rocketmq-client-go/issues/759#issuecomment-1000637851


   @wenfengwang i think the json decode method cause this problem. the current json here is different from my rocketmq cluster, fastjson-1.2.76.jar i wonder if there is some special config for json serialization? if we can find why json is different, may be use different json lib in rocketmq or different fastjson version? the fix is apperent.


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

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



[GitHub] [rocketmq-client-go] wenfengwang closed issue #759: Master code reset consumer offset cause program exit

Posted by GitBox <gi...@apache.org>.
wenfengwang closed issue #759:
URL: https://github.com/apache/rocketmq-client-go/issues/759


   


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

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