This is an automated email from the ASF dual-hosted git repository.
dinglei 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 3d5dab0 fix(nameserver): panic in nameserver size is changed. (#529)
3d5dab0 is described below
commit 3d5dab0405228dda740554a04ab06263e8e99e7d
Author: dinglei <[email protected]>
AuthorDate: Thu Sep 3 11:56:14 2020 +0800
fix(nameserver): panic in nameserver size is changed. (#529)
---
internal/namesrv.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/internal/namesrv.go b/internal/namesrv.go
index 6d8ff2b..371b431 100644
--- a/internal/namesrv.go
+++ b/internal/namesrv.go
@@ -120,7 +120,7 @@ func (s *namesrvs) getNameServerAddress() string {
s.lock.Lock()
defer s.lock.Unlock()
- addr := s.srvs[s.index]
+ addr := s.srvs[s.index%len(s.srvs)]
index := s.index + 1
if index < 0 {
index = -index