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

github.com/pingcap/tidb/ttl/ttlworker.(*ttlScanWorker).loop will leak #41490

Closed
Tracked by #41316
hawkingrei opened this issue Feb 16, 2023 · 4 comments
Closed
Tracked by #41316
Assignees
Labels
affects-7.0 affects-7.1 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. may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 may-affects-6.4 may-affects-6.5 may-affects-6.6 severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@hawkingrei
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

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

3. What did you see instead (Required)

--- PASS: TestAbnormalSessionPool (2.29s)

PASS

coverage: 12.9% of statements

goleak: Errors on successful test run: found unexpected goroutines:

[Goroutine 20607 in state select, with github.com/pingcap/tidb/ttl/ttlworker.(*ttlScanWorker).loop on top of the stack:

goroutine 20607 [select]:

github.com/pingcap/tidb/ttl/ttlworker.(*ttlScanWorker).loop(0xc0084acd80)

	ttl/ttlworker/scan.go:296 +0x19a

github.com/pingcap/tidb/ttl/ttlworker.(*baseWorker).loop(0xc008e60fd0?)

	ttl/ttlworker/worker.go:134 +0x85

github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()

	util/wait_group_wrapper.go:154 +0x6b

created by github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run

	util/wait_group_wrapper.go:152 +0x8d


 Goroutine 17696 in state select, with github.com/pingcap/tidb/ttl/ttlworker.(*JobManager).jobLoop on top of the stack:

goroutine 17696 [select]:

github.com/pingcap/tidb/ttl/ttlworker.(*JobManager).jobLoop(0xc007a0a000)

	ttl/ttlworker/job_manager.go:167 +0x565

github.com/pingcap/tidb/ttl/ttlworker.(*baseWorker).loop(0x2a5d18b?)

	ttl/ttlworker/worker.go:134 +0x85

github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()

	util/wait_group_wrapper.go:154 +0x6b

created by github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run

	util/wait_group_wrapper.go:152 +0x8d


 Goroutine 20613 in state select, with github.com/pingcap/tidb/ttl/ttlworker.(*ttlDeleteWorker).loop on top of the stack:

goroutine 20613 [select]:

github.com/pingcap/tidb/ttl/ttlworker.(*ttlDeleteWorker).loop(0xc008493180)

	ttl/ttlworker/del.go:281 +0x2eb

github.com/pingcap/tidb/ttl/ttlworker.(*baseWorker).loop(0xc004d1afb0?)

	ttl/ttlworker/worker.go:134 +0x85

github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()

	util/wait_group_wrapper.go:154 +0x6b

created by github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run

	util/wait_group_wrapper.go:152 +0x8d


 Goroutine 20612 in state select, with github.com/pingcap/tidb/ttl/ttlworker.(*ttlDeleteWorker).loop on top of the stack:

goroutine 20612 [select]:

github.com/pingcap/tidb/ttl/ttlworker.(*ttlDeleteWorker).loop(0xc008493100)

	ttl/ttlworker/del.go:281 +0x2eb

github.com/pingcap/tidb/ttl/ttlworker.(*baseWorker).loop(0x2a5d18b?)

	ttl/ttlworker/worker.go:134 +0x85

github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()

	util/wait_group_wrapper.go:154 +0x6b

created by github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run

	util/wait_group_wrapper.go:152 +0x8d


 Goroutine 20605 in state chan receive, with github.com/pingcap/tidb/ttl/client.(*mockClient).WatchCommand.func1 on top of the stack:

goroutine 20605 [chan receive]:

github.com/pingcap/tidb/ttl/client.(*mockClient).WatchCommand.func1()

	ttl/client/command.go:419 +0x69

created by github.com/pingcap/tidb/ttl/client.(*mockClient).WatchCommand

	ttl/client/command.go:418 +0x31c


 Goroutine 20609 in state select, with github.com/pingcap/tidb/ttl/ttlworker.(*ttlScanWorker).loop on top of the stack:

goroutine 20609 [select]:

github.com/pingcap/tidb/ttl/ttlworker.(*ttlScanWorker).loop(0xc0084acea0)

	ttl/ttlworker/scan.go:296 +0x19a

github.com/pingcap/tidb/ttl/ttlworker.(*baseWorker).loop(0xc004bb3fd0?)

	ttl/ttlworker/worker.go:134 +0x85

github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()

	util/wait_group_wrapper.go:154 +0x6b

created by github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run

	util/wait_group_wrapper.go:152 +0x8d


 Goroutine 20608 in state select, with github.com/pingcap/tidb/ttl/ttlworker.(*ttlScanWorker).loop on top of the stack:

goroutine 20608 [select]:

github.com/pingcap/tidb/ttl/ttlworker.(*ttlScanWorker).loop(0xc0084ace10)

	ttl/ttlworker/scan.go:296 +0x19a

github.com/pingcap/tidb/ttl/ttlworker.(*baseWorker).loop(0xc00016afd0?)

	ttl/ttlworker/worker.go:134 +0x85

github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()

	util/wait_group_wrapper.go:154 +0x6b

created by github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run

	util/wait_group_wrapper.go:152 +0x8d


 Goroutine 20610 in state select, with github.com/pingcap/tidb/ttl/ttlworker.(*ttlDeleteWorker).loop on top of the stack:

goroutine 20610 [select]:

github.com/pingcap/tidb/ttl/ttlworker.(*ttlDeleteWorker).loop(0xc008493000)

	ttl/ttlworker/del.go:281 +0x2eb

github.com/pingcap/tidb/ttl/ttlworker.(*baseWorker).loop(0x2a5d18b?)

	ttl/ttlworker/worker.go:134 +0x85

github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()

	util/wait_group_wrapper.go:154 +0x6b

created by github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run

	util/wait_group_wrapper.go:152 +0x8d


 Goroutine 20611 in state select, with github.com/pingcap/tidb/ttl/ttlworker.(*ttlDeleteWorker).loop on top of the stack:

goroutine 20611 [select]:

github.com/pingcap/tidb/ttl/ttlworker.(*ttlDeleteWorker).loop(0xc008493080)

	ttl/ttlworker/del.go:281 +0x2eb

github.com/pingcap/tidb/ttl/ttlworker.(*baseWorker).loop(0xc00016b7d0?)

	ttl/ttlworker/worker.go:134 +0x85

github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()

	util/wait_group_wrapper.go:154 +0x6b

created by github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run

	util/wait_group_wrapper.go:152 +0x8d


 Goroutine 20606 in state select, with github.com/pingcap/tidb/ttl/ttlworker.(*ttlScanWorker).loop on top of the stack:

goroutine 20606 [select]:

github.com/pingcap/tidb/ttl/ttlworker.(*ttlScanWorker).loop(0xc0084ac2d0)

	ttl/ttlworker/scan.go:296 +0x19a

github.com/pingcap/tidb/ttl/ttlworker.(*baseWorker).loop(0xc008a1e7d0?)

	ttl/ttlworker/worker.go:134 +0x85

github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()

	util/wait_group_wrapper.go:154 +0x6b

created by github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run

	util/wait_group_wrapper.go:152 +0x8d

]

--

4. What is your TiDB version? (Required)

@hawkingrei hawkingrei added the type/bug The issue is confirmed as a bug. label Feb 16, 2023
@YangKeao YangKeao self-assigned this Feb 16, 2023
@YangKeao
Copy link
Member

Do you have any log for this test? I failed to reproduce it in my local environment, and it seems that these loops failed to stop while domain stops 🤔

@hawkingrei
Copy link
Member Author

Do you have any log for this test? I failed to reproduce it in my local environment, and it seems that these loops failed to stop while domain stops 🤔

I have forgotten to copy the log for this test and forget where it is found. 🤣

@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. may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 may-affects-6.4 may-affects-6.5 may-affects-6.6 labels Feb 16, 2023
@lcwangchao
Copy link
Collaborator

This leak only found in test. Set it to major

@Defined2014
Copy link
Contributor

Defined2014 commented May 16, 2023

I think it's same as #43855, so close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.0 affects-7.1 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. may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 may-affects-6.4 may-affects-6.5 may-affects-6.6 severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

7 participants