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

panic: send on closed channel #29610

Closed
ChenPeng2013 opened this issue Nov 9, 2021 · 8 comments
Closed

panic: send on closed channel #29610

ChenPeng2013 opened this issue Nov 9, 2021 · 8 comments
Assignees
Labels
affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.0 affects-6.1 This bug affects the 6.1.x(LTS) versions. severity/minor sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@ChenPeng2013
Copy link
Contributor

ChenPeng2013 commented Nov 9, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

panic: send on closed channel [recovered]
        panic: send on closed channel

goroutine 766775274 [running]:
github.com/pingcap/tidb/executor.(*IndexMergeReaderExecutor).handleHandlesFetcherPanic.func1(0x38f2ac0, 0x420f910)
        /home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/index_merge_reader.go:619 +0x205
github.com/pingcap/tidb/util.WithRecovery.func1(0xc2faf42f30)
        /home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/util/misc.go:92 +0x354
panic(0x38f2ac0, 0x420f910)
        /usr/local/go/src/runtime/panic.go:965 +0x1b9
github.com/pingcap/tidb/executor.(*partialTableWorker).syncErr(...)
        /home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/index_merge_reader.go:432
github.com/pingcap/tidb/executor.(*partialTableWorker).fetchHandles(0xc02cdabdd0, 0x429f548, 0xc2ec561ec0, 0xc17c86c720, 0xc13bf13320, 0xc13bf13200, 0xc17c86c5a0, 0x42cd6f8, 0xc2eb6c8d20, 0xa, ...)
        /home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/index_merge_reader.go:448 +0x678
github.com/pingcap/tidb/executor.(*IndexMergeReaderExecutor).startPartialTableWorker.func1.1()
        /home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/index_merge_reader.go:374 +0x5ba
github.com/pingcap/tidb/util.WithRecovery(0xc3295def08, 0xc2faf42f30)
        /home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/util/misc.go:100 +0x4f
github.com/pingcap/tidb/executor.(*IndexMergeReaderExecutor).startPartialTableWorker.func1(0x429f5f0, 0xc2f818d950, 0xc1e8ad8900, 0xc0ff91f0e0, 0x0, 0xc2f480d540, 0x1, 0x1, 0xc17c86c720, 0xc13bf13320)
        /home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/index_merge_reader.go:326 +0x1e5
created by github.com/pingcap/tidb/executor.(*IndexMergeReaderExecutor).startPartialTableWorker
        /home/jenkins/agent/workspace/optimization-build-tidb-linux-amd/go/src/github.com/pingcap/tidb/executor/index_merge_reader.go:323 +0x238

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

Release Version: v5.3.0
Edition: Community
Git Commit Hash: bdc9987370d6d393cb8acae22e238e3350e448b5
Git Branch: heads/refs/tags/v5.3.0
UTC Build Time: 2021-11-03 13:20:53
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
@ChenPeng2013 ChenPeng2013 added type/bug The issue is confirmed as a bug. sig/execution SIG execution severity/major affects-5.3 This bug affects 5.3.x versions. labels Nov 9, 2021
@ChenPeng2013
Copy link
Contributor Author

the default of tidb_enable_index_merge is off, so the severity is set to major

@fuzhe1989
Copy link
Contributor

/assign @guo-shaoge

@guo-shaoge
Copy link
Collaborator

Is this a failed ci log? Can we reproduce this error? @ChenPeng2013

@guo-shaoge
Copy link
Collaborator

guo-shaoge commented Nov 15, 2021

Why we got the error: the partialIndexWorker got an error and it tries to give this error to the main worker through resultCh. But the resultCh is already closed(maybe Close() is called already).

Because there is too little log information, it is hard to get a more accurate conclusion. IMO, it's not a big problem.

@ChenPeng2013
Copy link
Contributor Author

Is this a failed ci log? Can we reproduce this error? @ChenPeng2013

I found it by tidb_error.log and don't have a way to reproduce

@guo-shaoge
Copy link
Collaborator

Is this a failed ci log? Can we reproduce this error? @ChenPeng2013

I found it by tidb_error.log and don't have a way to reproduce

I will update the pr and verify the fix.

@jebter jebter added the affects-5.4 This bug affects the 5.4.x(LTS) versions. label Jan 11, 2022
@VelocityLight VelocityLight added the affects-6.1 This bug affects the 6.1.x(LTS) versions. label May 20, 2022
@zanmato1984
Copy link
Contributor

Adjusting severity to minor.

@guo-shaoge
Copy link
Collaborator

#41036
this refactor pr can fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.0 affects-6.1 This bug affects the 6.1.x(LTS) versions. severity/minor sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants