From 649ebbd5a6b884c27f9b592423e304b8cf0d8e45 Mon Sep 17 00:00:00 2001 From: Tiexin Guo Date: Thu, 26 Sep 2024 13:45:12 +0800 Subject: [PATCH] chore: remove fix for another issue and use fallthrough --- internals/overlord/servstate/handlers.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/internals/overlord/servstate/handlers.go b/internals/overlord/servstate/handlers.go index 937c4cbb..c1422712 100644 --- a/internals/overlord/servstate/handlers.go +++ b/internals/overlord/servstate/handlers.go @@ -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) @@ -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)