Skip to content

Commit bfda6a4

Browse files
committed
storeliveness: adopt stopper handle
1 parent 0e97aef commit bfda6a4

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

pkg/kv/kvserver/storeliveness/support_manager.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,17 @@ func (sm *SupportManager) Start(ctx context.Context) error {
178178
return err
179179
}
180180

181-
return sm.stopper.RunAsyncTask(
182-
ctx, "storeliveness.SupportManager: loop", sm.startLoop,
183-
)
181+
ctx, hdl, err := sm.stopper.GetHandle(ctx, stop.TaskOpts{
182+
TaskName: "storeliveness.SupportManager: loop",
183+
})
184+
if err != nil {
185+
return err
186+
}
187+
go func(ctx context.Context) {
188+
defer hdl.Activate(ctx).Release(ctx)
189+
sm.startLoop(ctx)
190+
}(ctx)
191+
return nil
184192
}
185193

186194
// onRestart initializes the SupportManager with state persisted on disk.

0 commit comments

Comments
 (0)