apache / apache/rocketmq-client-go

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

Open
#1,170 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
1.4k
Forks
445
PR merge metrics
No merged PRs in 30d

Description

The issue tracker is **ONLY** used for the go client (feature request of RocketMQ need to follow [RIP process](https://github.com/apache/rocketmq/wiki/RocketMQ-Improvement-Proposal)). 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](http://rocketmq.apache.org/about/contact/). 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](https://github.com/user-attachments/assets/41802a20-d387-4085-aff8-559dd366be6e)
![image](https://github.com/user-attachments/assets/69e771c2-572b-4452-8a70-74a0a9c5b7a5)
![image](https://github.com/user-attachments/assets/ab7ddd74-cb58-4bd0-a5c4-db4d2806c4ac)
![image](https://github.com/user-attachments/assets/2954d538-53d3-40a9-b95f-5d1903cb79b2)
![image](https://github.com/user-attachments/assets/d09bf6f6-4e78-4c2d-ae97-99ef4f90bcf4)

- 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

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.