Skip to content

Commit

Permalink
Add stack dump to log on sigquit of sti builder
Browse files Browse the repository at this point in the history
  • Loading branch information
bparees committed Aug 21, 2015
1 parent 76c60f0 commit 198f501
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pkg/cmd/infra/builder/builder.go
@@ -1,6 +1,12 @@
package builder

import (
"os"
"os/signal"
"runtime"
"syscall"

"github.com/golang/glog"
"github.com/spf13/cobra"

"github.com/openshift/origin/pkg/build/builder/cmd"
Expand Down Expand Up @@ -28,6 +34,18 @@ func NewCommandSTIBuilder(name string) *cobra.Command {
Short: "Run a Source-to-Images build",
Long: stiBuilderLong,
Run: func(c *cobra.Command, args []string) {
go func() {
for {
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGQUIT)
buf := make([]byte, 1<<20)
for {
<-sigs
runtime.Stack(buf, true)
glog.Infof("=== received SIGQUIT ===\n*** goroutine dump...\n%s\n*** end\n", buf)
}
}
}()
cmd.RunSTIBuild()
},
}
Expand Down

0 comments on commit 198f501

Please sign in to comment.