Skip to content
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

Goroutine leak in slowQueryRetriever.parseSlowLog #32656

Closed
djshow832 opened this issue Feb 28, 2022 · 0 comments · Fixed by #32757
Closed

Goroutine leak in slowQueryRetriever.parseSlowLog #32656

djshow832 opened this issue Feb 28, 2022 · 0 comments · Fixed by #32757
Assignees
Labels
affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@djshow832
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

goroutine 221431 [chan send, 9 minutes]:
github.com/pingcap/tidb/executor.(*slowQueryRetriever).parseSlowLog(0xc09392b480, 0x4038470, 0xc09b4dc360, 0x407eb58, 0xc092c7ae00, 0xc13d6ddf50, 0x40)
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/slow_query.go:451 +0x23e
github.com/pingcap/tidb/executor.(*slowQueryRetriever).parseDataForSlowLog(0xc09392b480, 0x4038470, 0xc09b4dc360, 0x407eb58, 0xc092c7ae00)
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/slow_query.go:191 +0x1d1
created by github.com/pingcap/tidb/executor.(*slowQueryRetriever).initializeAsyncParsing
/home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/slow_query.go:1045 +0x98

2. What did you expect to see? (Required)

No leak

3. What did you see instead (Required)

When dataForSlowLog is cancelled, parseSlowLog stucks at e.taskList <- t for 9 minutes.

#27471 just fixed https://github.com/pingcap/tidb/blob/v5.2.3/executor/slow_query.go#L435 , but there's another leak in https://github.com/pingcap/tidb/blob/v5.2.3/executor/slow_query.go#L451 .

4. What is your TiDB version? (Required)

master

@djshow832 djshow832 added type/bug The issue is confirmed as a bug. sig/sql-infra SIG: SQL Infra severity/major labels Feb 28, 2022
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. labels Feb 28, 2022
@djshow832 djshow832 self-assigned this Feb 28, 2022
@djshow832 djshow832 added affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects the 5.4.x(LTS) versions. and removed may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. labels Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants