-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
executor: migrate goroutine leak tests to goleak #27405
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: tison <wander4096@gmail.com>
@@ -8569,7 +8569,7 @@ func (s testSerialSuite) assertTemporaryTableNoNetwork(c *C, temporaryTableType | |||
// With that failpoint, all requests to the TiKV is discard. | |||
rs, err := tk1.Exec("select * from normal") | |||
c.Assert(err, IsNil) | |||
blocked := make(chan struct{}) | |||
blocked := make(chan struct{}, 1) |
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 should be a buffer channel to unblock L8576, otherwise the anon goroutine blocked and leaks.
@@ -60,6 +60,11 @@ func (s *testTableSampleSuite) SetUpSuite(c *C) { | |||
s.domain = d | |||
} | |||
|
|||
func (s *testTableSampleSuite) TearDownSuite(c *C) { | |||
s.domain.Close() |
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.
do not close domain and store generates 30+ goroutine leaks
/run-check_dev_2 |
opts := []goleak.Option{ | ||
goleak.IgnoreTopFunction("go.etcd.io/etcd/pkg/logutil.(*MergeLogger).outputLoop"), | ||
goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"), | ||
goleak.IgnoreTopFunction("gopkg.in/natefinch/lumberjack%2ev2.(*Logger).millRun"), |
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.
but still I don't know where this function comes from.
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.
IIRC, outputLoop
comes from the etcd client. I don't know where lumberjack
is. You may try go mod graph
.
`
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.
@xhebox I found it comes from pingcap/log
func initFileLog(cfg *FileLogConfig) (*lumberjack.Logger, error) {
return &lumberjack.Logger
}
millRun
seems like a daemon goroutine that range on millCh
which is never closed.
func (l *Logger) millRun() {
for _ = range l.millCh {
// what am I going to do, log this?
_ = l.millRunOnce()
}
}
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.
natefinch/lumberjack#56, It's a goroutine leak bug.
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.
lgtm
/merge |
This pull request has been accepted and is ready to merge. Commit hash: bb6bc87
|
@tisonkun: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. 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 ti-community-infra/tichi repository. |
/run-check_dev_2 |
1 similar comment
/run-check_dev_2 |
Signed-off-by: tison wander4096@gmail.com
What problem does this PR solve?
Issue Number: close #27404
Release note