Merge pull request #335 from gyuho/k

agent: workaround for java kill
This commit is contained in:
Gyu-Ho Lee 2017-03-16 09:10:21 -07:00 committed by GitHub
commit a16f2f17de
1 changed files with 10 additions and 6 deletions

View File

@ -210,15 +210,19 @@ func (t *transporterServer) Transfer(ctx context.Context, req *dbtesterpb.Reques
plog.Infof("waiting a few more seconds before stopping %q", t.cmd.Path) plog.Infof("waiting a few more seconds before stopping %q", t.cmd.Path)
time.Sleep(3 * time.Second) time.Sleep(3 * time.Second)
// TODO: https://github.com/coreos/dbtester/issues/330
plog.Infof("sending %q to %q [PID: %d]", syscall.SIGINT, t.cmd.Path, t.pid) plog.Infof("sending %q to %q [PID: %d]", syscall.SIGINT, t.cmd.Path, t.pid)
if err := t.cmd.Process.Signal(syscall.SIGINT); err != nil { if err := t.cmd.Process.Signal(syscall.SIGINT); err != nil {
return nil, err plog.Warningf("syscall.SIGINT failed with %v", err)
}
time.Sleep(3 * time.Second) time.Sleep(3 * time.Second)
plog.Infof("sending %q to %q [PID: %d]", syscall.SIGTERM, t.cmd.Path, t.pid) plog.Infof("sending %q to %q [PID: %d]", syscall.SIGTERM, t.cmd.Path, t.pid)
if err := syscall.Kill(int(t.pid), syscall.SIGTERM); err != nil { if err := syscall.Kill(int(t.pid), syscall.SIGTERM); err != nil {
plog.Warningf("syscall.Kill failed with %v", err) plog.Warningf("syscall.Kill failed with %v", err)
}
} }
time.Sleep(time.Second)
<-t.cmdWait <-t.cmdWait
if t.databaseLogFile != nil { if t.databaseLogFile != nil {
t.databaseLogFile.Sync() t.databaseLogFile.Sync()