fix(dump): correct format string arguments for goroutine dump filename#5986
fix(dump): correct format string arguments for goroutine dump filename#5986Sukuna0007Abhi wants to merge 2 commits into
Conversation
|
Hi @Sukuna0007Abhi. Thanks for your PR. I'm waiting for a fluid-cloudnative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: Sukuna0007Abhi <appsonly310@gmail.com>
20d7ce0 to
ca7d619
Compare
There was a problem hiding this comment.
Code Review
This pull request fixes a bug in the goroutine dump generator where the dump file path was incorrectly formatted, resulting in files being created as /tmp-go.txt instead of inside the /tmp/go directory. The fix updates the arguments passed to fmt.Sprintf in pkg/dump/dump.go and removes the now-obsolete workarounds and cleanup logic for the buggy pattern in pkg/dump/dump_test.go. There are no review comments provided, and I have no additional feedback.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Plz review @cheyang @TrafalgarZZZ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5986 +/- ##
==========================================
- Coverage 63.56% 63.55% -0.01%
==========================================
Files 479 479
Lines 33276 33276
==========================================
- Hits 21151 21148 -3
- Misses 10445 10447 +2
- Partials 1680 1681 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
cheyang
left a comment
There was a problem hiding this comment.
Straightforward and correct fix. The format string "%s-%s.txt" has two verbs, but the old code passed three arguments ("/tmp", "go", timestamp). Go's fmt.Sprintf silently drops extra arguments, so the timestamp was never included in the filename -- every dump overwrote /tmp-go.txt.
The fix combines the first two args into "/tmp/go" so the call becomes fmt.Sprintf("%s-%s.txt", "/tmp/go", timestamp), producing /tmp/go-{timestamp}.txt as intended. The test cleanup removing the buggy-pattern workarounds is appropriate.
One minor thought: an alternative fix would be to change the format string to "%s/%s-%s.txt" so each path component is explicit. That said, the current approach is simple and correct, and dumpfile is only used in this one place.
LGTM.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cheyang The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Thanks a lot for approving @cheyang , let me fix the formatting |
240b1bd to
ca7d619
Compare
|
|
|
Hi @cheyang could you pls rerun the workflow so I can make sure the lint error is fixed or not |
|
@Sukuna0007Abhi: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |



Ⅰ. Describe what this PR does
This PR fixes a bug in
pkg/dump/dump.gowherefmt.Sprintfwas incorrectly provided 3 arguments for a format string that only accepted 2 ("%s-%s.txt"). This caused the generated dump filename to ignore the timestamp and hardcode the output to/tmp-go.txt.This PR:
fmt.Sprintfcall to correctly combine the path prefix.dump_test.gothat were previously hardcoded to look for the buggy/tmp-go.txtfilename.Ⅱ. Does this pull request fix one issue?
fixes #5985
Ⅲ. List the added test cases
Updated existing tests in
pkg/dump/dump_test.goto remove the workaround logic and verify the correct filepath generation.Ⅳ. Describe how to verify it
Run
go test -v ./pkg/dump/....