Fix a runtime deadlock as well as fixing some graceful exiting issues (#945)

This commit is contained in:
Asim Aslam
2019-11-14 14:26:21 +00:00
committed by GitHub
parent 16754a7477
commit 383658edf2
3 changed files with 55 additions and 9 deletions

View File

@@ -129,7 +129,12 @@ func (s *service) Stop() error {
if s.PID == nil {
return nil
}
return s.Process.Kill(s.PID)
// kill the process
err := s.Process.Kill(s.PID)
// wait for it to exit
s.Process.Wait(s.PID)
// return the kill error
return err
}
}