Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Master][v2.1.0-rc4][BUG] panic at internal.(*namesrvs). getNameServerAddress #527

Closed
dbl-x opened this issue Sep 2, 2020 · 0 comments · Fixed by #529
Closed

[Master][v2.1.0-rc4][BUG] panic at internal.(*namesrvs). getNameServerAddress #527

dbl-x opened this issue Sep 2, 2020 · 0 comments · Fixed by #529

Comments

@dbl-x
Copy link
Contributor

dbl-x commented Sep 2, 2020

BUG REPORT
Please add the branch name [Native]/[Master] at the header of the Isssue title.

  1. Please describe the issue you observed:

    • When concurrent UpdateNameServerAddress and getNameServerAddress, because namesrvs.srvs has changed, and namesrvs.index is not adjusted accordingly, the execution of "s.srvs[s.index]" causes the array to out of range
  2. Please tell us about your environment:

    • rocketmq-client-go: v2.1.0-rc4 and master
  3. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):

panic: runtime error: index out of range [5] with length 5

goroutine 257 [running]:
github.com/apache/rocketmq-client-go/v2/internal.(*namesrvs).getNameServerAddress(0xc000c92240, 0x0, 0x0)
        /go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/internal/namesrv.go:123 +0x16d
github.com/apache/rocketmq-client-go/v2/internal.(*namesrvs).queryTopicRouteInfoFromServer(0xc000c92240, 0xc000eb9580, 0x31, 0x479ad0, 0xc00194ebe0, 0xc000760340)
        /go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/internal/route.go:355 +0x274
github.com/apache/rocketmq-client-go/v2/internal.(*namesrvs).UpdateTopicRouteInfoWithDefault(0xc000c92240, 0xc000eb9580, 0x31, 0x0, 0x0, 0x0, 0x0, 0xc000a7f200, 0x0, 0x0)
        /go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/internal/route.go:132 +0xcf
github.com/apache/rocketmq-client-go/v2/internal.(*namesrvs).UpdateTopicRouteInfo(...)
        /go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/internal/route.go:116
github.com/apache/rocketmq-client-go/v2/internal.(*rmqClient).UpdateTopicRouteInfo(0xc0007fe340)
        /go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/internal/client.go:527 +0x17d
github.com/apache/rocketmq-client-go/v2/internal.(*rmqClient).Start.func1.2.1(...)
        /go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/internal/client.go:292
github.com/apache/rocketmq-client-go/v2/internal.(*rmqClient).Start.func1.2()
        /go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/internal/client.go:302 +0x156
github.com/apache/rocketmq-client-go/v2/primitive.WithRecover(0xc000760430)
        /go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/primitive/base.go:96 +0x49
created by github.com/apache/rocketmq-client-go/v2/internal.(*rmqClient).Start.func1
        /go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/internal/client.go:289 +0x10e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant