Skip to content

Commit

Permalink
chore: remove fix for another issue and use fallthrough
Browse files Browse the repository at this point in the history
  • Loading branch information
IronCore864 committed Sep 26, 2024
1 parent 2c66795 commit 649ebbd
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions internals/overlord/servstate/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,12 +512,6 @@ func (s *serviceData) exited(exitCode int) error {
case stateStarting:
s.started <- fmt.Errorf("exited quickly with code %d", exitCode)
s.transition(stateExited) // not strictly necessary as doStart will return, but doesn't hurt
action, onType := getAction(s.config, exitCode == 0)
switch action {
case plan.ActionRestart:
s.doBackoff(action, onType)
default:
}

case stateRunning:
logger.Noticef("Service %q stopped unexpectedly with code %d", s.config.Name, exitCode)
Expand Down Expand Up @@ -690,13 +684,7 @@ func (s *serviceData) stop() error {
switch s.state {
case stateStarting:
s.started <- fmt.Errorf("stopped before the 1 second okay delay")
logger.Debugf("Attempting to stop service %q by sending SIGTERM", s.config.Name)
err := syscall.Kill(-s.cmd.Process.Pid, syscall.SIGTERM)
if err != nil {
logger.Noticef("Cannot send SIGTERM to process: %v", err)
}
s.transition(stateTerminating)
time.AfterFunc(s.killDelay(), func() { logError(s.terminateTimeElapsed()) })
fallthrough

case stateRunning:
logger.Debugf("Attempting to stop service %q by sending SIGTERM", s.config.Name)
Expand Down

0 comments on commit 649ebbd

Please sign in to comment.