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 EnableCollectExecutionInfo #38408

Closed
hawkingrei opened this issue Oct 11, 2022 · 1 comment · Fixed by #38409
Closed

DATA RACE at the EnableCollectExecutionInfo #38408

hawkingrei opened this issue Oct 11, 2022 · 1 comment · Fixed by #38409
Assignees
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.

Comments

@hawkingrei
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

==================
WARNING: DATA RACE
Write at 0x00c004e5c1d0 by goroutine 564671:
  github.com/pingcap/tidb/infoschema_test.TestVariablesInfo()
      infoschema/tables_test.go:1536 +0x55b
  testing.tRunner()
      GOROOT/src/testing/testing.go:1446 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1493 +0x47
Previous read at 0x00c004e5c1d0 by goroutine 575126:
  github.com/pingcap/tidb/executor.ResetContextOfStmt()
      executor/executor.go:2112 +0x3038
  github.com/pingcap/tidb/session.(*session).ExecuteStmt()
      session/session.go:2064 +0x391
  github.com/pingcap/tidb/session.(*session).ExecRestrictedSQL.func1()
      session/session.go:2024 +0x2b7
  github.com/pingcap/tidb/session.(*session).withRestrictedSQLExecutor()
      session/session.go:2010 +0x391
  github.com/pingcap/tidb/session.(*session).ExecRestrictedSQL()
      session/session.go:2014 +0x124
  github.com/pingcap/tidb/domain.(*Domain).refreshMDLCheckTableInfo()
      domain/domain.go:632 +0x421
  github.com/pingcap/tidb/domain.(*Domain).loadSchemaInLoop()
      domain/domain.go:782 +0x17b
  github.com/pingcap/tidb/domain.(*Domain).Init.func9()
      domain/domain.go:1028 +0x64
Goroutine 564671 (running) created at:
  testing.(*T).Run()
      GOROOT/src/testing/testing.go:1493 +0x75d
  testing.runTests.func1()
      GOROOT/src/testing/testing.go:1846 +0x99
  testing.tRunner()
      GOROOT/src/testing/testing.go:1446 +0x216
  testing.runTests()
      GOROOT/src/testing/testing.go:1844 +0x7ec
  testing.(*M).Run()
      GOROOT/src/testing/testing.go:1726 +0xa84
  go.uber.org/goleak.VerifyTestMain()
      external/org_uber_go_goleak/testmain.go:53 +0x70
  github.com/pingcap/tidb/infoschema.TestMain()
      infoschema/main_test.go:31 +0x31b
  main.main()
      bazel-out/k8-fastbuild/bin/infoschema/infoschema_test_/testmain.go:214 +0x5e8
Goroutine 575126 (running) created at:
  github.com/pingcap/tidb/domain.(*Domain).Init()
      domain/domain.go:1028 +0x146d
  github.com/pingcap/tidb/session.(*domainMap).Get.func1()
      session/tidb.go:93 +0x6c4
  github.com/pingcap/tidb/util.RunWithRetry()
      util/misc.go:69 +0x93
  github.com/pingcap/tidb/session.(*domainMap).Get()
      session/tidb.go:76 +0x258
  github.com/pingcap/tidb/session.createSessionWithOpt()
      session/session.go:2963 +0x75
  github.com/pingcap/tidb/session.createSession()
      session/session.go:2959 +0x84
  github.com/pingcap/tidb/session.createSessions()
      session/session.go:2948 +0x6e
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:2824 +0x337
  github.com/pingcap/tidb/testkit.bootstrap()
      testkit/mockstore.go:76 +0x8c
  github.com/pingcap/tidb/testkit.CreateMockStoreAndDomain()
      testkit/mockstore.go:67 +0xe9
  github.com/pingcap/tidb/testkit.CreateMockStore()
      testkit/mockstore.go:59 +0x373
  github.com/pingcap/tidb/infoschema_test.TestVariablesInfo()
      infoschema/tables_test.go:1508 +0x58
  testing.tRunner()
      GOROOT/src/testing/testing.go:1446 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1493 +0x47
================== 

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

@hawkingrei hawkingrei added the type/bug This issue is a bug. label Oct 11, 2022
@CbcWestwolf
Copy link
Member

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/sql-infra SIG: SQL Infra type/bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants