diff --git a/domain/domain.go b/domain/domain.go index d00fb08fd8..116ae67324 100644 --- a/domain/domain.go +++ b/domain/domain.go @@ -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 } diff --git a/tidb-server/main.go b/tidb-server/main.go index cb5e30e62e..48456c371e 100644 --- a/tidb-server/main.go +++ b/tidb-server/main.go @@ -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.