Skip to content

Commit

Permalink
testserver: use SIGTERM instead of SIGKILL during upgrade
Browse files Browse the repository at this point in the history
This makes it shutdown gracefully instead of abruptly.
  • Loading branch information
rafiss committed Mar 10, 2023
1 parent ad4962b commit d465a56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion testserver/testservernode.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"log"
"os/exec"
"strings"
"syscall"
)

func (ts *testServerImpl) StopNode(nodeNum int) error {
Expand All @@ -29,7 +30,7 @@ func (ts *testServerImpl) StopNode(nodeNum int) error {

// Kill the process.
if cmd.Process != nil {
if err := cmd.Process.Kill(); err != nil {
if err := cmd.Process.Signal(syscall.SIGTERM); err != nil {
return err
}
if _, err := cmd.Process.Wait(); err != nil {
Expand Down

0 comments on commit d465a56

Please sign in to comment.