1469
1470
// FinishStop should only be called by the controller.
1472
>
// After this returns, engineFuture.Set may not be called anymore, so if we don't get see
1473
>
// an Engine here, we won't ever have one.
1474
>
_ = s.transition(contextRequestFinishStop{})
1475
>
1476
>
// Use a context that we know is cancelled so that this doesn't block.
1477
>
engine, _ := s.engineFuture.Get(s.lifecycleCtx)
1478
>
1479
>
// Stop the engine if it was running (outside the lock but before returning).
1480
>
if engine != nil {
1481
s.contextTaggedLogger.Info("", tag.LifeCycleStopping, tag.ComponentShardEngine)
1482
engine.Stop()