Skip to content

SetSelector causes data race #904

@sergeydobrodey

Description

@sergeydobrodey

==================
WARNING: DATA RACE
Read at 0x00c000266fc8 by goroutine 211:
github.com/smallnest/rpcx/client.(*xClient).watch()
/go/pkg/mod/github.com/smallnest/rpcx@v1.8.32/client/xclient.go:224 +0x388
github.com/smallnest/rpcx/client.NewXClient.gowrap1()
/go/pkg/mod/github.com/smallnest/rpcx@v1.8.32/client/xclient.go:145 +0x4c

Previous write at 0x00c000266fc8 by goroutine 88:
github.com/smallnest/rpcx/client.(*xClient).SetSelector()
/go/pkg/mod/github.com/smallnest/rpcx@v1.8.32/client/xclient.go:74 +0xa8

Steps to reproduce:

Create xclient/pool with user selected selector:

client.NewXClientPool(config.PoolSize, "", client.Failover, client.SelectByUser, discovery, opts)

Call SetSelector (for pool - var xclient = pool.Get().SetSelector(NewUserDefinedSelectorName(...))

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions