Skip to content

fix(dump): correct format string arguments for goroutine dump filename#5986

Open
Sukuna0007Abhi wants to merge 2 commits into
fluid-cloudnative:masterfrom
Sukuna0007Abhi:fix-dump-filename-bug
Open

fix(dump): correct format string arguments for goroutine dump filename#5986
Sukuna0007Abhi wants to merge 2 commits into
fluid-cloudnative:masterfrom
Sukuna0007Abhi:fix-dump-filename-bug

Conversation

@Sukuna0007Abhi

Copy link
Copy Markdown

Ⅰ. Describe what this PR does

This PR fixes a bug in pkg/dump/dump.go where fmt.Sprintf was 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:

  1. Fixes the fmt.Sprintf call to correctly combine the path prefix.
  2. Removes the legacy workaround checks in dump_test.go that were previously hardcoded to look for the buggy /tmp-go.txt filename.

Ⅱ. Does this pull request fix one issue?

fixes #5985

Ⅲ. List the added test cases

Updated existing tests in pkg/dump/dump_test.go to remove the workaround logic and verify the correct filepath generation.

Ⅳ. Describe how to verify it

Run go test -v ./pkg/dump/....

@fluid-e2e-bot

fluid-e2e-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

Signed-off-by: Sukuna0007Abhi <appsonly310@gmail.com>
@Sukuna0007Abhi Sukuna0007Abhi force-pushed the fix-dump-filename-bug branch from 20d7ce0 to ca7d619 Compare June 12, 2026 18:43

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Sukuna0007Abhi

Copy link
Copy Markdown
Author

Plz review @cheyang @TrafalgarZZZ

@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.55%. Comparing base (ae86e7c) to head (ca7d619).
⚠️ Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cheyang cheyang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@fluid-e2e-bot

fluid-e2e-bot Bot commented Jun 13, 2026

Copy link
Copy Markdown

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Sukuna0007Abhi

Copy link
Copy Markdown
Author

Thanks a lot for approving @cheyang , let me fix the formatting

@Sukuna0007Abhi Sukuna0007Abhi force-pushed the fix-dump-filename-bug branch from 240b1bd to ca7d619 Compare June 13, 2026 17:59
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@Sukuna0007Abhi

Copy link
Copy Markdown
Author

Hi @cheyang could you pls rerun the workflow so I can make sure the lint error is fixed or not

@fluid-e2e-bot

fluid-e2e-bot Bot commented Jun 14, 2026

Copy link
Copy Markdown

@Sukuna0007Abhi: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

/ok-to-test

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Goroutine dump generator generates static /tmp-go.txt filename due to incorrect format string arguments

2 participants