Skip to content

Commit

Permalink
Don't cut off stack traces at 32MB. (hashicorp#11364)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncabatoff authored and AndreyZamyslov committed Jun 10, 2021
1 parent 9f503a4 commit ba89e4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelog/11364.txt
@@ -0,0 +1,3 @@
```release-note:improvement
core: allow arbitrary length stack traces upon receiving SIGUSR2 (was 32MB)
```
6 changes: 3 additions & 3 deletions command/server.go
Expand Up @@ -14,6 +14,7 @@ import (
"os"
"path/filepath"
"runtime"
"runtime/pprof"
"sort"
"strconv"
"strings"
Expand Down Expand Up @@ -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)
}
}

Expand Down

0 comments on commit ba89e4b

Please sign in to comment.