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: TestSimple #42746

Closed
Tracked by #41316
D3Hunter opened this issue Apr 3, 2023 · 1 comment
Closed
Tracked by #41316

DATA RACE: TestSimple #42746

D3Hunter opened this issue Apr 3, 2023 · 1 comment
Labels
component/test severity/moderate type/bug The issue is confirmed as a bug.

Comments

@D3Hunter
Copy link
Contributor

D3Hunter commented Apr 3, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

current master
https://do.pingcap.net/jenkins/blue/organizations/jenkins/pingcap%2Ftidb%2Fghpr_unit_test/detail/ghpr_unit_test/21085/pipeline/

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

3. What did you see instead (Required)

[2023/04/03 11:28:25.817 +08:00] [INFO] [dispatcher.go:213] ["check task, subtasks aren't finished"] ["task ID"=1] [cnt=20]
    dispatcher_test.go:182: 
        	Error Trace:	disttask/framework/dispatcher/dispatcher_test.go:182
        	            				disttask/framework/dispatcher/dispatcher_test.go:239
        	Error:      	Not equal: 
        	            	expected: 20
        	            	actual  : 10
        	Test:       	TestSimpleNormalFlow
[2023/04/03 11:28:25.840 +08:00] [INFO] [dispatcher.go:236] ["detect task loop exits"] [error="context canceled"]
[2023/04/03 11:28:25.843 +08:00] [INFO] [dispatcher.go:148] ["dispatch task loop exits"] [error="context canceled"] [interval=30]
[2023/04/03 11:28:25.905 +08:00] [INFO] [dispatcher.go:213] ["check task, subtasks aren't finished"] ["task ID"=1] [cnt=20]
[2023/04/03 11:28:25.907 +08:00] [INFO] [dispatcher.go:252] ["detect task exits"] ["task ID"=1] [error="context canceled"]
==================
WARNING: DATA RACE
Read at 0x00000a1c7ed8 by goroutine 105320:
  github.com/pingcap/tidb/disttask/framework/dispatcher.(*dispatcher).DispatchTaskLoop()
      disttask/framework/dispatcher/dispatcher.go:152 +0x1f7
  github.com/pingcap/tidb/disttask/framework/dispatcher.(*dispatcher).DispatchTaskLoop-fm()
      <autogenerated>:1 +0x39
  github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run.func1()
      util/wait_group_wrapper.go:154 +0x87

Previous write at 0x00000a1c7ed8 by goroutine 52136:
  github.com/pingcap/tidb/disttask/framework/dispatcher_test.checkDispatch.func1()
      disttask/framework/dispatcher/dispatcher_test.go:147 +0x71
  runtime.deferCallSave()
      GOROOT/src/runtime/panic.go:796 +0x87
  testing.(*T).FailNow()
      <autogenerated>:1 +0x37
  github.com/stretchr/testify/require.Equal()
      external/com_github_stretchr_testify/require/require.go:165 +0xeb
  github.com/pingcap/tidb/disttask/framework/dispatcher_test.checkDispatch()
      disttask/framework/dispatcher/dispatcher_test.go:182 +0x5e6
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3324 +0x7cc
  github.com/pingcap/tidb/domain.(*Domain).GetSessionCache()
      domain/sysvar_cache.go:62 +0x71
  github.com/pingcap/tidb/session.(*session).loadCommonGlobalVariablesIfNeeded()
      session/session.go:3666 +0x11e
  github.com/pingcap/tidb/session.(*session).ExecuteStmt()
      session/session.go:2103 +0x16b
  github.com/pingcap/tidb/session.(*session).ExecuteInternal()
      session/session.go:1638 +0x365
  github.com/pingcap/tidb/domain.(*Domain).LoadPrivilegeLoop()
      domain/domain.go:1530 +0x143
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3317 +0x76c
  github.com/pingcap/tidb/testkit.bootstrap()
      testkit/mockstore.go:85 +0x84
  github.com/pingcap/tidb/testkit.CreateMockStoreAndDomain()
      testkit/mockstore.go:70 +0xd0
  github.com/pingcap/tidb/testkit.CreateMockStore()
      testkit/mockstore.go:62 +0x3b2
  github.com/pingcap/tidb/disttask/framework/dispatcher_test.MockDispatcher()
      disttask/framework/dispatcher/dispatcher_test.go:38 +0x55
  github.com/pingcap/tidb/disttask/framework/dispatcher_test.checkDispatch()
      disttask/framework/dispatcher/dispatcher_test.go:141 +0xa6
  github.com/pingcap/tidb/disttask/framework/dispatcher_test.TestSimpleNormalFlow()
      disttask/framework/dispatcher/dispatcher_test.go:239 +0x38
  testing.tRunner()
      GOROOT/src/testing/testing.go:1576 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1629 +0x47

Goroutine 105320 (running) created at:
  github.com/pingcap/tidb/util.(*WaitGroupWrapper).Run()
      util/wait_group_wrapper.go:152 +0xf6
  github.com/pingcap/tidb/disttask/framework/dispatcher.(*dispatcher).Start()
      disttask/framework/dispatcher/dispatcher.go:129 +0xae
  github.com/pingcap/tidb/domain.(*Domain).distTaskFrameworkLoop.func2()
      domain/domain.go:1404 +0x2d0
  github.com/pingcap/tidb/domain.(*Domain).distTaskFrameworkLoop()
      domain/domain.go:1424 +0x321
  github.com/pingcap/tidb/domain.(*Domain).initDistTaskLoop.func1()
      domain/domain.go:1378 +0x177
  github.com/pingcap/tidb/util.(*WaitGroupEnhancedWrapper).Run.func1()
      util/wait_group_wrapper.go:96 +0xde

Goroutine 52136 (running) created at:
  testing.(*T).Run()
      GOROOT/src/testing/testing.go:1629 +0x805
  testing.runTests.func1()
      GOROOT/src/testing/testing.go:2036 +0x8d
  testing.tRunner()
      GOROOT/src/testing/testing.go:1576 +0x216
  testing.runTests()
      GOROOT/src/testing/testing.go:2034 +0x87c
  testing.(*M).Run()
      GOROOT/src/testing/testing.go:1906 +0xb44
  go.uber.org/goleak.VerifyTestMain()
      external/org_uber_go_goleak/testmain.go:53 +0x70
  github.com/pingcap/tidb/disttask/framework/dispatcher.TestMain()
      disttask/framework/dispatcher/main_test.go:49 +0x632
  main.main()
      bazel-out/k8-fastbuild/bin/disttask/framework/dispatcher/dispatcher_test_/testmain.go:126 +0x7ce
==================

4. What is your TiDB version? (Required)

@D3Hunter D3Hunter added the type/bug The issue is confirmed as a bug. label Apr 3, 2023
@D3Hunter D3Hunter changed the title data race: TestSimple DATA RACE: TestSimple Apr 3, 2023
@hawkingrei
Copy link
Member

fixed by #42790

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/test severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants