Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
fix data race
Previous read at 0x00c00013bd08 by goroutine 129:
github.com/apache/rocketmq-client-go/v2/internal.(*rmqClient).InvokeSync()
/Users/xxx/go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/internal/client.go:576 +0x95
github.com/apache/rocketmq-client-go/v2/consumer.(*defaultConsumer).findConsumerList()
/Users/xxx/go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/consumer/consumer.go:952 +0x25b
github.com/apache/rocketmq-client-go/v2/consumer.(*defaultConsumer).doBalance.func1()
/Users/xxx/go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/consumer/consumer.go:393 +0x164
sync.(*Map).Range()
/usr/local/Cellar/go/1.19/libexec/src/sync/map.go:354 +0x225
github.com/apache/rocketmq-client-go/v2/consumer.(*defaultConsumer).doBalance()
/Users/xxx/go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/consumer/consumer.go:370 +0x56
github.com/apache/rocketmq-client-go/v2/consumer.(*defaultConsumer).doBalanceIfNotPaused()
/Users/xxx/go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/consumer/consumer.go:366 +0x117
github.com/apache/rocketmq-client-go/v2/consumer.(*pushConsumer).RebalanceIfNotPaused()
/Users/xxx/go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/consumer/push_consumer.go:335 +0x3d
github.com/apache/rocketmq-client-go/v2/internal.(*rmqClient).RebalanceIfNotPaused.func1()
/Users/xxx/go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/internal/client.go:879 +0x48
sync.(*Map).Range()
/usr/local/Cellar/go/1.19/libexec/src/sync/map.go:354 +0x225
github.com/apache/rocketmq-client-go/v2/internal.(*rmqClient).RebalanceIfNotPaused()
/Users/xxx/go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/internal/client.go:877 +0x95
github.com/apache/rocketmq-client-go/v2/internal.GetOrNewRocketMQClient.func1()
/Users/xxx/go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/internal/client.go:231 +0x125
github.com/apache/rocketmq-client-go/v2/internal/remote.(*remotingClient).processCMD.func2()
/Users/xxx/go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/internal/remote/remote_client.go:244 +0x95
github.com/apache/rocketmq-client-go/v2/primitive.WithRecover()
/Users/xxx/go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/primitive/base.go:100 +0x48
github.com/apache/rocketmq-client-go/v2/internal/remote.(*remotingClient).processCMD.func4()
/Users/xxx/go/pkg/mod/github.com/apache/rocketmq-client-go/[email protected]/internal/remote/remote_client.go:243 +0x39