-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
operator: print callstack when exiting before preparing done #51371
Conversation
Signed-off-by: Yu Juncen <[email protected]>
Signed-off-by: Yu Juncen <[email protected]>
Hi @YuJuncen. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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: Yu Juncen <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #51371 +/- ##
================================================
+ Coverage 70.6430% 73.0579% +2.4149%
================================================
Files 1459 1465 +6
Lines 434200 453774 +19574
================================================
+ Hits 306732 331518 +24786
+ Misses 108243 101896 -6347
- Partials 19225 20360 +1135
Flags with carried forward coverage won't be shown. Click here to find out more.
|
func StartExitSingleListener(ctx context.Context) (context.Context, context.CancelFunc) { | ||
cx, cancel := context.WithCancel(ctx) | ||
sc := make(chan os.Signal, 1) | ||
signal.Notify(sc, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To confirm, will a normal init job exit print the go routines also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, goroutine dump won't be printed once prepare done.
/cc @WangLe1321 ptal. |
br/pkg/utils/misc.go
Outdated
fmt.Println() | ||
printDelimate(fmt.Sprintf("Got signal %v to exit.", sig)) | ||
printDelimate(fmt.Sprintf("Required Goroutine Dump = %v", dumpGoroutine)) | ||
if DumpGoroutineWhenExit.Load() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use dumpGoroutine
?
br/pkg/utils/misc.go
Outdated
printDelimate(fmt.Sprintf("Required Goroutine Dump = %v", dumpGoroutine)) | ||
if DumpGoroutineWhenExit.Load() { | ||
printDelimate("Start Dumping Goroutine") | ||
os.Stdout.Write(AllStackInfo()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use fmt.Println(AllStackInfo())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug.PrintStack()
uses write
. I think there isn't many difference between them.
Signed-off-by: Yu Juncen <[email protected]>
Signed-off-by: Yu Juncen <[email protected]>
@WangLe1321: adding LGTM is restricted to approvers and reviewers in OWNERS files. In 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
@@ -141,6 +142,7 @@ func AdaptEnvForSnapshotBackup(ctx context.Context, cfg *PauseGcConfig) error { | |||
if cfg.OnAllReady != nil { | |||
cfg.OnAllReady() | |||
} | |||
utils.DumpGoroutineWhenExit.Store(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems no need set it back
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 3pointer, BornChanger, WangLe1321 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
@YuJuncen: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
/retest |
@BornChanger: Cannot trigger testing until a trusted user reviews the PR and leaves an In 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. |
/run-cherry-picker |
/run-cherry-picker |
In response to a cherrypick label: new pull request created to branch |
…#51371) (pingcap#46) (pingcap#61) close pingcap#51370 Co-authored-by: 山岚 <[email protected]>
…#51371) (pingcap#46) close pingcap#51370 Co-authored-by: 山岚 <[email protected]>
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
What problem does this PR solve?
Issue Number: close #51370
Problem Summary:
It is hard to debug what happens when the init pod get timed out.
What changed and how does it work?
This PR will print all gorouintes to
stdout
once theprepare-for-snapshot-backup
command exits before finishing the full prepare stage.Check List
Tests
When we are not yet finished:
When we have finished prepare stage:
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.