Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stack dump to log on sigquit of sti builder #4321

Merged
merged 1 commit into from Aug 22, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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