Repository navigation
server: allow on-demand goroutine dumps - #159352
Merged
Merged
Conversation
Member
4 tasks
tbg
commented
Jan 9, 2026
tbg
left a comment
Contributor
Author
There was a problem hiding this comment.
@tbg made 1 comment.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @tbg).
-- commits line 7 at r1:
A later commit will make this the only way, so if it bothers you that there's two ways right now, know that it will resolve.
tbg
marked this pull request as ready for review
January 9, 2026 11:34
tbg
requested review from
a team,
alyshanjahani-crl and
angeladietz
and removed request for
a team
January 9, 2026 11:34
Move goroutine dumper creation out of startSampleEnvironment so it can be shared with other subsystems. Keep sampling/heuristic dumping behavior unchanged by allowing a pre-built dumper to be passed in.
Add (*GoroutineDumper).DumpNow(ctx, reason) as a placeholder API for future on-demand goroutine dumps. This commit introduces the method signature only; it does not take dumps yet.
Add an optional StoreConfig callback for triggering on-demand goroutine dumps. Wire the server-owned goroutine dumper into store config when a goroutine dump directory is configured.
Implement DumpNow to write a goroutine dump tagged on_demand while keeping the existing filename schema unchanged. Log the redactable reason and gate requests via server.goroutine_dump.on_demand.min_interval (default 10s).
Both callers now pass it in, which is cleaner.
alyshanjahani-crl
approved these changes
Jan 15, 2026
angeladietz
approved these changes
Jan 15, 2026
Contributor
|
bors r+ |
Contributor
|
Build succeeded: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable programmatic, rate-limited goroutine dumps that KV can trigger on demand.
Move goroutine dumper construction out of env sampling so it can be shared. Add (*GoroutineDumper).DumpNow(ctx, reason) (reason logged, not in the filename), and plumb it down to KV via kvserver.StoreConfig.GoroutineDumpNow. Implement DumpNow to write a dump tagged on_demand while preserving the existing naming scheme, and gate requests via server.goroutine_dump.on_demand.min_interval (default 10s).
Closes #159342
Epic: none