This is an automated email from the ASF dual-hosted git repository.
yuzhou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-go.git
The following commit(s) were added to refs/heads/master by this push:
new 9b8bb01 [ISSUE #1194] check trace topic message queues length before
queue-select to avoid divided-by-zero panic (#1195)
9b8bb01 is described below
commit 9b8bb010b3d8304f19d12e8b8b61765dfe5ce806
Author: muyun.cyt <[email protected]>
AuthorDate: Mon Apr 14 20:45:07 2025 +0800
[ISSUE #1194] check trace topic message queues length before queue-select
to avoid divided-by-zero panic (#1195)
Co-authored-by: muyun.cyt <[email protected]>
---
internal/trace.go | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/internal/trace.go b/internal/trace.go
index 24e075c..0901763 100644
--- a/internal/trace.go
+++ b/internal/trace.go
@@ -504,6 +504,13 @@ func (td *traceDispatcher) findMq(regionID string)
(*primitive.MessageQueue, str
})
return nil, ""
}
+ if len(mqs) == 0 {
+ rlog.Warning("could not fetch any publish message queue",
map[string]interface{}{
+ "topic": traceTopic,
+ })
+ return nil, ""
+ }
+
i := atomic.AddInt32(&td.rrindex, 1)
if i < 0 {
i = 0