test: fix data race in resouce control interceptor initialization (#44789)
close pingcap/tidb#44776
This commit is contained in:
@ -1382,6 +1382,7 @@ func (do *Domain) initResourceGroupsController(ctx context.Context, pdClient pd.
|
||||
serverAddr := net.JoinHostPort(serverInfo.IP, strconv.Itoa(int(serverInfo.Port)))
|
||||
do.runawayManager = resourcegroup.NewRunawayManager(control, serverAddr)
|
||||
do.resourceGroupsController = control
|
||||
tikv.SetResourceControlInterceptor(control)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@ -238,7 +238,6 @@ func main() {
|
||||
resourcemanager.InstanceResourceManager.Start()
|
||||
storage, dom := createStoreAndDomain(keyspaceName)
|
||||
svr := createServer(storage, dom)
|
||||
tikv.SetResourceControlInterceptor(dom.ResourceGroupsController())
|
||||
|
||||
// Register error API is not thread-safe, the caller MUST NOT register errors after initialization.
|
||||
// To prevent misuse, set a flag to indicate that register new error will panic immediately.
|
||||
|
||||
Reference in New Issue
Block a user