Skip to content

Commit

Permalink
Improve stacktrace to fix tech debts
Browse files Browse the repository at this point in the history
Signed-off-by: divyansh42 <diagrawa@redhat.com>
  • Loading branch information
divyansh42 committed Oct 27, 2023
1 parent 3aa55dd commit 0826910
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,14 @@ func (d *stiDocker) RunContainer(opts RunContainerOptions) error {
if signal == syscall.SIGQUIT {
buf := make([]byte, 1<<16)
runtime.Stack(buf, true)
fmt.Printf("%s", buf)
f, err := os.Create("/var/log/s2i_docker_stack_trace.log")
if err != nil {
return
}
defer f.Close()
w := bufio.NewWriter(f)
fmt.Printf(w, "%s", buf)
w.Flush()
}
os.Exit(2)
}
Expand Down

0 comments on commit 0826910

Please sign in to comment.