mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-03 20:17:59 +00:00
Don't cut off stack traces at 32MB. (#11364)
This commit is contained in:
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"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"runtime/pprof"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -1969,9 +1970,8 @@ CLUSTER_SYNTHESIS_COMPLETE:
|
|||||||
}
|
}
|
||||||
|
|
||||||
case <-c.SigUSR2Ch:
|
case <-c.SigUSR2Ch:
|
||||||
buf := make([]byte, 32*1024*1024)
|
logWriter := c.logger.StandardWriter(&hclog.StandardLoggerOptions{})
|
||||||
n := runtime.Stack(buf[:], true)
|
pprof.Lookup("goroutine").WriteTo(logWriter, 2)
|
||||||
c.logger.Info("goroutine trace", "stack", string(buf[:n]))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user