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

DATA RACE at the pkg/executor/sortexec/sort.go:133 #52238

Closed
Tracked by #41316
hawkingrei opened this issue Mar 29, 2024 · 0 comments · Fixed by #52246
Closed
Tracked by #41316

DATA RACE at the pkg/executor/sortexec/sort.go:133 #52238

hawkingrei opened this issue Mar 29, 2024 · 0 comments · Fixed by #52246
Labels
severity/moderate sig/execution SIG execution 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)

==================
WARNING: DATA RACE
Write at 0x00c0006be658 by goroutine 62:
  github.com/pingcap/tidb/pkg/executor/sortexec.(*SortExec).Close()
      pkg/executor/sortexec/sort.go:133 +0x71c
  github.com/pingcap/tidb/pkg/executor/sortexec_test.parallelSortTest()
      pkg/executor/sortexec/parallel_sort_test.go:97 +0x364
  github.com/pingcap/tidb/pkg/executor/sortexec_test.TestParallelSort()
      pkg/executor/sortexec/parallel_sort_test.go:129 +0x48e
  github.com/pingcap/failpoint.parseTerm()
      external/com_github_pingcap_failpoint/terms.go:149 +0x364
  github.com/pingcap/failpoint.parse()
      external/com_github_pingcap_failpoint/terms.go:126 +0xa5
  github.com/pingcap/failpoint.newTerms()
      external/com_github_pingcap_failpoint/terms.go:98 +0x3e
  github.com/pingcap/failpoint.(*Failpoint).Enable()
      external/com_github_pingcap_failpoint/failpoint.go:54 +0x3e
  github.com/pingcap/failpoint.(*Failpoints).Enable()
      external/com_github_pingcap_failpoint/failpoints.go:105 +0x296
  github.com/pingcap/failpoint.Enable()
      external/com_github_pingcap_failpoint/failpoints.go:222 +0x1ed
  github.com/pingcap/tidb/pkg/executor/sortexec_test.TestParallelSort()
      pkg/executor/sortexec/parallel_sort_test.go:123 +0x1c9
  github.com/pingcap/failpoint.parseTerm()
      external/com_github_pingcap_failpoint/terms.go:149 +0x364
  github.com/pingcap/failpoint.parse()
      external/com_github_pingcap_failpoint/terms.go:126 +0xa5
  github.com/pingcap/failpoint.newTerms()
      external/com_github_pingcap_failpoint/terms.go:98 +0x3e
  github.com/pingcap/failpoint.(*Failpoint).Enable()
      external/com_github_pingcap_failpoint/failpoint.go:54 +0x3e
  github.com/pingcap/failpoint.(*Failpoints).Enable()
      external/com_github_pingcap_failpoint/failpoints.go:105 +0x296
  github.com/pingcap/failpoint.Enable()
      external/com_github_pingcap_failpoint/failpoints.go:222 +0x1c8
  github.com/pingcap/tidb/pkg/executor/sortexec_test.TestParallelSort()
      pkg/executor/sortexec/parallel_sort_test.go:122 +0x1a4
  testing.tRunner()
      GOROOT/src/testing/testing.go:1595 +0x261
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1648 +0x44
Previous write at 0x00c0006be658 by goroutine 69:
  github.com/pingcap/tidb/pkg/executor/sortexec.(*SortExec).generateResult.func1()
      pkg/executor/sortexec/sort.go:449 +0x21e
  runtime.deferreturn()
      GOROOT/src/runtime/panic.go:477 +0x30
  github.com/pingcap/tidb/pkg/executor/sortexec.(*SortExec).fetchChunksParallel.func3()
      pkg/executor/sortexec/sort.go:685 +0x89
Goroutine 62 (running) created at:
  testing.(*T).Run()
      GOROOT/src/testing/testing.go:1648 +0x845
  testing.runTests.func1()
      GOROOT/src/testing/testing.go:2054 +0x84
  testing.tRunner()
      GOROOT/src/testing/testing.go:1595 +0x261
  testing.runTests()
      GOROOT/src/testing/testing.go:2052 +0x8ad
  testing.(*M).Run()
      GOROOT/src/testing/testing.go:1925 +0xcd7
  main.main()
      bazel-out/k8-fastbuild/bin/pkg/executor/sortexec/sortexec_test_/testmain.go:143 +0x5d1
Goroutine 69 (finished) created at:
  github.com/pingcap/tidb/pkg/executor/sortexec.(*SortExec).fetchChunksParallel()
      pkg/executor/sortexec/sort.go:685 +0x9aa
  github.com/pingcap/tidb/pkg/executor/sortexec.(*SortExec).fetchChunks()
      pkg/executor/sortexec/sort.go:535 +0x92
  github.com/pingcap/tidb/pkg/executor/sortexec.(*SortExec).Next()
      pkg/executor/sortexec/sort.go:277 +0x339
  github.com/pingcap/tidb/pkg/executor/sortexec_test.executeSortExecutor()
      pkg/executor/sortexec/sort_spill_test.go:178 +0x124
  github.com/pingcap/tidb/pkg/executor/sortexec_test.parallelSortTest()
      pkg/executor/sortexec/parallel_sort_test.go:95 +0x344
  github.com/pingcap/tidb/pkg/executor/sortexec_test.TestParallelSort()
      pkg/executor/sortexec/parallel_sort_test.go:129 +0x48e
  github.com/pingcap/failpoint.parseTerm()
      external/com_github_pingcap_failpoint/terms.go:149 +0x364
  github.com/pingcap/failpoint.parse()
      external/com_github_pingcap_failpoint/terms.go:126 +0xa5
  github.com/pingcap/failpoint.newTerms()
      external/com_github_pingcap_failpoint/terms.go:98 +0x3e
  github.com/pingcap/failpoint.(*Failpoint).Enable()
      external/com_github_pingcap_failpoint/failpoint.go:54 +0x3e
  github.com/pingcap/failpoint.(*Failpoints).Enable()
      external/com_github_pingcap_failpoint/failpoints.go:105 +0x296
  github.com/pingcap/failpoint.Enable()
      external/com_github_pingcap_failpoint/failpoints.go:222 +0x1ed
  github.com/pingcap/tidb/pkg/executor/sortexec_test.TestParallelSort()
      pkg/executor/sortexec/parallel_sort_test.go:123 +0x1c9
  github.com/pingcap/failpoint.parseTerm()
      external/com_github_pingcap_failpoint/terms.go:149 +0x364
  github.com/pingcap/failpoint.parse()
      external/com_github_pingcap_failpoint/terms.go:126 +0xa5
  github.com/pingcap/failpoint.newTerms()
      external/com_github_pingcap_failpoint/terms.go:98 +0x3e
  github.com/pingcap/failpoint.(*Failpoint).Enable()
      external/com_github_pingcap_failpoint/failpoint.go:54 +0x3e
  github.com/pingcap/failpoint.(*Failpoints).Enable()
      external/com_github_pingcap_failpoint/failpoints.go:105 +0x296
  github.com/pingcap/failpoint.Enable()
      external/com_github_pingcap_failpoint/failpoints.go:222 +0x1c8
  github.com/pingcap/tidb/pkg/executor/sortexec_test.TestParallelSort()
      pkg/executor/sortexec/parallel_sort_test.go:122 +0x1a4
  testing.tRunner()
      GOROOT/src/testing/testing.go:1595 +0x261
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1648 +0x44
================== 

4. What is your TiDB version? (Required)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate 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.

1 participant