Skip to content

Commit e64d663

Browse files
craig[bot]suj-krishnan
andcommitted
161855: spanconfig: Use context with cancel for span config manager r=suj-krishnan a=suj-krishnan Per the discussion in cockroachdb#161166, it is possible for the span config reconciliation job to be deprioritised for a long time by admission control in a resource starved environment. The context in the span config manager background task must support cancellation so that the job check does not block during a shutdown. Epic: None Fixes: cockroachdb#161166 Release note: None Co-authored-by: Sujatha Sivaramakrishnan <sujatha.sivaramakrishnan@cockroachlabs.com>
2 parents e01438c + 4d945c0 commit e64d663

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/spanconfig/spanconfigmanager/manager.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ func New(
8686
// recreating it if it doesn't.
8787
func (m *Manager) Start(ctx context.Context) error {
8888
return m.stopper.RunAsyncTask(ctx, "span-config-mgr", func(ctx context.Context) {
89+
ctx, cancel := m.stopper.WithCancelOnQuiesce(ctx)
90+
defer cancel()
91+
8992
m.run(ctx)
9093
})
9194
}

0 commit comments

Comments
 (0)