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 when replace stmt exceed mem_quota #49882

Closed
wshwsh12 opened this issue Dec 28, 2023 · 0 comments · Fixed by #49885
Closed

Goroutine leak when replace stmt exceed mem_quota #49882

wshwsh12 opened this issue Dec 28, 2023 · 0 comments · Fixed by #49885

Comments

@wshwsh12
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists t1, t2, t3;
create table t1 (id int key, a int, index (a));
create table t2 (id int key, a int, index (a), constraint fk_1 foreign key (a) references t1(a));
alter table t2 drop foreign key fk_1;
alter table t2 add constraint fk_1 foreign key (a) references t1(a) on delete set null;
replace into t1 values (1, 1);
set tidb_mem_quota_query = 8500;
replace into t1 values (1, 2);

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

No goroutine leak.

3. What did you see instead (Required)

goroutine 42087 [semacquire]:
sync.runtime_Semacquire(0xc003a75f4c?)
	/usr/local/go/src/runtime/sema.go:62 +0x25
sync.(*WaitGroup).Wait(0xc0070302a0?)
	/usr/local/go/src/sync/waitgroup.go:116 +0x48
github.com/pingcap/tidb/pkg/store/copr.(*copIteratorTaskSender).run(0xc0030d24b0, 0xc0093ccb70?)
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/store/copr/coprocessor.go:912 +0x1d0
created by github.com/pingcap/tidb/pkg/store/copr.(*copIterator).open in goroutine 21407
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/store/copr/coprocessor.go:879 +0x405

goroutine 43539 [select]:
github.com/pingcap/tidb/pkg/store/copr.(*copIteratorWorker).sendToRespCh(0xc0065313b0?, 0x63aa108?, 0xc006542f00?, 0x6?)
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/store/copr/coprocessor.go:1003 +0xa6
github.com/pingcap/tidb/pkg/store/copr.(*copIteratorWorker).run(0xc0065313b0, {0x63aa108, 0xc006542f00})
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/store/copr/coprocessor.go:821 +0xe5
created by github.com/pingcap/tidb/pkg/store/copr.(*copIterator).open in goroutine 21407
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/store/copr/coprocessor.go:861 +0x99

goroutine 50402 [select]:
github.com/pingcap/tidb/pkg/store/copr.(*copIteratorWorker).sendToRespCh(0xc00c9435e0?, 0x63aa108?, 0xc00dc74750?, 0x50?)
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/store/copr/coprocessor.go:1003 +0xa6
github.com/pingcap/tidb/pkg/store/copr.(*copIteratorWorker).run(0xc00c9435e0, {0x63aa108, 0xc00dc74750})
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/store/copr/coprocessor.go:821 +0xe5
created by github.com/pingcap/tidb/pkg/store/copr.(*copIterator).open in goroutine 21407
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/tidb/pkg/store/copr/coprocessor.go:861 +0x99

4. What is your TiDB version? (Required)

ed291b8

@wshwsh12 wshwsh12 added the type/bug This issue is a bug. label Dec 28, 2023
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this issue Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant