Skip to content

Commit

Permalink
Merge pull request #1079 from tjungblu/fix_liveness_test
Browse files Browse the repository at this point in the history
dump all goroutines, not the current stack
  • Loading branch information
openshift-merge-robot committed Jul 26, 2023
2 parents 9d025df + edb398b commit 381ffb8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/operator/health/aliveness_checker.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package health

import (
"runtime/debug"
"runtime"
"sync"

"k8s.io/klog/v2"
Expand Down Expand Up @@ -31,7 +31,11 @@ func (r *MultiAlivenessChecker) Alive() bool {
for s, checker := range r.checkerMap {
if !checker.Alive() {
klog.Warningf("Controller [%s] didn't sync for a long time, declaring unhealthy and dumping stack", s)
debug.PrintStack()
// 12 mb should be enough for a full goroutine dump
buf := make([]byte, 1024*1024*12)
n := runtime.Stack(buf, true)
klog.Warningf("%s", buf[:n])

return false
}
}
Expand Down

0 comments on commit 381ffb8

Please sign in to comment.