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 in the TestManagerHandleTasks #50297

Closed
Tracked by #41316
hawkingrei opened this issue Jan 11, 2024 · 1 comment · Fixed by #50304
Closed
Tracked by #41316

DATA RACE in the TestManagerHandleTasks #50297

hawkingrei opened this issue Jan 11, 2024 · 1 comment · Fixed by #50304
Labels
component/ddl This issue is related to DDL of TiDB. severity/moderate 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 0x00c000fa26a0 by goroutine 63:
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.TestManagerHandleTasks.func3()
      pkg/disttask/framework/taskexecutor/manager_test.go:310 +0x46
  runtime.call32()
      src/runtime/asm_amd64.s:748 +0x42
  reflect.Value.Call()
      GOROOT/src/reflect/value.go:380 +0xb5
  go.uber.org/mock/gomock.(*Call).DoAndReturn.func1()
      external/org_uber_go_mock/gomock/call.go:138 +0x944
  go.uber.org/mock/gomock.(*Controller).Call()
      external/org_uber_go_mock/gomock/controller.go:229 +0x11c
  github.com/pingcap/tidb/pkg/disttask/framework/mock.(*MockTaskExecutor).Run()
      pkg/disttask/framework/mock/task_executor_mock.go:394 +0x189
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.(*Manager).handleExecutableTask()
      pkg/disttask/framework/taskexecutor/manager.go:402 +0x10a3
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.(*Manager).handleExecutableTasks.func1()
      pkg/disttask/framework/taskexecutor/manager.go:257 +0xfb
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.TestManagerHandleTasks.getPoolRunFn.func7.1()
      pkg/disttask/framework/taskexecutor/manager_test.go:38 +0x81
Previous read at 0x00c000fa26a0 by goroutine 67:
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.TestManagerHandleTasks.func4()
      pkg/disttask/framework/taskexecutor/manager_test.go:315 +0x33
  github.com/stretchr/testify/assert.Eventually.func1()
      external/com_github_stretchr_testify/assert/assertions.go:1852 +0x33
Goroutine 63 (running) created at:
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.TestManagerHandleTasks.getPoolRunFn.func7()
      pkg/disttask/framework/taskexecutor/manager_test.go:36 +0xe4
  runtime.call16()
      src/runtime/asm_amd64.s:747 +0x42
  reflect.Value.Call()
      GOROOT/src/reflect/value.go:380 +0xb5
  go.uber.org/mock/gomock.(*Call).DoAndReturn.func1()
      external/org_uber_go_mock/gomock/call.go:138 +0x944
  go.uber.org/mock/gomock.(*Controller).Call()
      external/org_uber_go_mock/gomock/controller.go:229 +0x11c
  github.com/pingcap/tidb/pkg/disttask/framework/mock.(*MockPool).Run()
      pkg/disttask/framework/mock/task_executor_mock.go:289 +0xe6
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.(*Manager).handleExecutableTasks()
      pkg/disttask/framework/taskexecutor/manager.go:255 +0x605
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.(*Manager).handleTasks()
      pkg/disttask/framework/taskexecutor/manager.go:223 +0x64e
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.TestManagerHandleTasks()
      pkg/disttask/framework/taskexecutor/manager_test.go:313 +0x1b67
  testing.tRunner()
      GOROOT/src/testing/testing.go:1595 +0x261
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1648 +0x44
Goroutine 67 (finished) created at:
  github.com/stretchr/testify/assert.Eventually()
      external/com_github_stretchr_testify/assert/assertions.go:1852 +0x3b5
  github.com/stretchr/testify/require.Eventually()
      external/com_github_stretchr_testify/require/require.go:401 +0xb5
  github.com/pingcap/tidb/pkg/disttask/framework/taskexecutor.TestManagerHandleTasks()
      pkg/disttask/framework/taskexecutor/manager_test.go:314 +0x1c5c
  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)

@hawkingrei hawkingrei added the type/bug The issue is confirmed as a bug. label Jan 11, 2024
ti-chi-bot bot pushed a commit that referenced this issue Jan 11, 2024
@jebter jebter added the component/ddl This issue is related to DDL of TiDB. label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/ddl This issue is related to DDL of TiDB. severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants