Skip to content

Commit

Permalink
Merge pull request #6846 from porridge/abort-on-timeout
Browse files Browse the repository at this point in the history
Abort on timeout, to get stack traces.
  • Loading branch information
k8s-ci-robot authored Feb 15, 2018
2 parents ac95bc5 + 3247419 commit ffd664e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions kubetest/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ func finishRunning(cmd *exec.Cmd) error {
intLock.Lock()
interrupted = true
intLock.Unlock()
log.Printf("Interrupt after %s timeout during %s. Will terminate in another 15m", timeout, stepName)
log.Printf("Abort after %s timeout during %s. Will terminate in another 15m", timeout, stepName)
terminate.Reset(15 * time.Minute)
if err := syscall.Kill(-cmd.Process.Pid, syscall.SIGINT); err != nil {
log.Printf("Failed to interrupt %s. Will terminate immediately: %v", stepName, err)
if err := syscall.Kill(-cmd.Process.Pid, syscall.SIGABRT); err != nil {
log.Printf("Failed to abort %s. Will terminate immediately: %v", stepName, err)
syscall.Kill(-cmd.Process.Pid, syscall.SIGTERM)
cmd.Process.Kill()
}
Expand Down Expand Up @@ -287,9 +287,9 @@ func executeParallelCommand(cmd *exec.Cmd, resChan chan cmdExecResult, termChan,
}

case <-intChan:
log.Printf("Interrupt after %s timeout during %s. Will terminate in another 15m", timeout, strings.Join(cmd.Args, " "))
if err := syscall.Kill(-cmd.Process.Pid, syscall.SIGINT); err != nil {
log.Printf("Failed to interrupt %s. Will terminate immediately: %v", strings.Join(cmd.Args, " "), err)
log.Printf("Abort after %s timeout during %s. Will terminate in another 15m", timeout, strings.Join(cmd.Args, " "))
if err := syscall.Kill(-cmd.Process.Pid, syscall.SIGABRT); err != nil {
log.Printf("Failed to abort %s. Will terminate immediately: %v", strings.Join(cmd.Args, " "), err)
syscall.Kill(-cmd.Process.Pid, syscall.SIGTERM)
cmd.Process.Kill()
}
Expand Down

0 comments on commit ffd664e

Please sign in to comment.