mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-28 04:10:44 -04:00
Don't cut off stack traces at 32MB. (#11364)
This commit is contained in:
parent
4157ed4730
commit
5a17c4e5ff
2 changed files with 6 additions and 3 deletions
3
changelog/11364.txt
Normal file
3
changelog/11364.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
```release-note:improvement
|
||||
core: allow arbitrary length stack traces upon receiving SIGUSR2 (was 32MB)
|
||||
```
|
||||
|
|
@ -14,6 +14,7 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"runtime/pprof"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
|
@ -1969,9 +1970,8 @@ CLUSTER_SYNTHESIS_COMPLETE:
|
|||
}
|
||||
|
||||
case <-c.SigUSR2Ch:
|
||||
buf := make([]byte, 32*1024*1024)
|
||||
n := runtime.Stack(buf[:], true)
|
||||
c.logger.Info("goroutine trace", "stack", string(buf[:n]))
|
||||
logWriter := c.logger.StandardWriter(&hclog.StandardLoggerOptions{})
|
||||
pprof.Lookup("goroutine").WriteTo(logWriter, 2)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue