fix(control): wait for SPN to fully stop before completing pause operation

This commit is contained in:
Alexandr Stelnykovych
2025-11-28 13:26:14 +02:00
parent b12729cb3a
commit 569e0a70dd
3 changed files with 83 additions and 12 deletions

View File

@@ -159,6 +159,16 @@ func (g *Group) Start() error {
return nil
}
// IsStopped returns whether the group is stopped.
// It returns an error if the group is in an invalid state.
func (g *Group) IsStopped() (bool, error) {
state := g.state.Load()
if state == groupStateInvalid {
return false, errors.New("invalid group state")
}
return g.state.Load() == groupStateOff, nil
}
// Stop stops all modules in the group in the reverse order.
func (g *Group) Stop() error {
// Check group state.