cockroachdb / cockroachdb/cockroach
debug: runtime patch to direct goroutine dumps to file/ds
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
**Is your feature request related to a problem? Please describe.**
`runtime.Stack` is a golang runtime function used to get a dump of all current goroutine stack traces. This is a "stop the world" operation, whereas a regular goroutine dump manages without stopping the world. We really only care about the latter, but sadly it's not currently possible to redirect one of these regular goroutine dumps (that don't stop the world) to a file or data structure. It's just not designed that way. This unfortunately makes it difficult to expose them via something like a gRPC endpoint.
**Describe the solution you'd like**
A runtime patch could allow us to direct these goroutine dumps that don't "stop the world" to a file or data structure, which would allow us to expose them in utilities like `debug zip` without having as heavy of a performance impact.
Jira issue: CRDB-31270
Epic: CRDB-31271
Contributor guide
Assessment
This issue has not been assessed yet.