Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yisaer committed Jan 17, 2023
1 parent 09343c0 commit b560c91
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 2 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ type Config struct {
TiDBMaxReuseChunk uint32 `toml:"tidb-max-reuse-chunk" json:"tidb-max-reuse-chunk"`
// TiDBMaxReuseColumn indicates max cached column num
TiDBMaxReuseColumn uint32 `toml:"tidb-max-reuse-column" json:"tidb-max-reuse-column"`
// TiDBEnableExitChecking indicates whether checking background process in domain during exiting
TiDBEnableExitChecking bool `toml:"tidb-enable-exit-checking" json:"tidb-enable-exit-checking"`
}

// UpdateTempStoragePath is to update the `TempStoragePath` if port/statusPort was changed
Expand Down
9 changes: 1 addition & 8 deletions domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ func NewDomain(store kv.Storage, ddlLease time.Duration, statsLease time.Duratio
jobsIdsMap: make(map[int64]string),
},
}
do.wg = util.NewWaitGroupEnhancedWrapper("domain", do.exit, enableEnhancedWaitGroupCheck.Load())
do.wg = util.NewWaitGroupEnhancedWrapper("domain", do.exit, config.GetGlobalConfig().TiDBEnableExitChecking)
do.SchemaValidator = NewSchemaValidator(ddlLease, do)
do.expensiveQueryHandle = expensivequery.NewExpensiveQueryHandle(do.exit)
do.memoryUsageAlarmHandle = memoryusagealarm.NewMemoryUsageAlarmHandle(do.exit)
Expand Down Expand Up @@ -1705,17 +1705,10 @@ func (do *Domain) SetupDumpFileGCChecker(ctx sessionctx.Context) {
}

var planReplayerHandleLease atomic.Uint64
var enableEnhancedWaitGroupCheck atomic.Bool

func init() {
planReplayerHandleLease.Store(uint64(10 * time.Second))
enableDumpHistoricalStats.Store(true)
enableEnhancedWaitGroupCheck.Store(true)
}

// DisableEnhancedWaitGroupCheck4Test diable check in test
func DisableEnhancedWaitGroupCheck4Test() {
enableEnhancedWaitGroupCheck.Store(false)
}

// DisablePlanReplayerBackgroundJob4Test disable plan replayer handle for test
Expand Down
1 change: 0 additions & 1 deletion testkit/mockstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ func bootstrap(t testing.TB, store kv.Storage, lease time.Duration) *domain.Doma
session.DisableStats4Test()
domain.DisablePlanReplayerBackgroundJob4Test()
domain.DisableDumpHistoricalStats4Test()
domain.DisableEnhancedWaitGroupCheck4Test()
dom, err := session.BootstrapSession(store)
require.NoError(t, err)

Expand Down

0 comments on commit b560c91

Please sign in to comment.