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 TestLongBinaryPlan #39746

Closed
hawkingrei opened this issue Dec 7, 2022 · 0 comments · Fixed by #39747
Closed

DATA RACE in the TestLongBinaryPlan #39746

hawkingrei opened this issue Dec 7, 2022 · 0 comments · Fixed by #39747
Labels
component/test 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)

==================
WARNING: DATA RACE
Write at 0x00000a7c18a0 by goroutine 200529:
  github.com/pingcap/tidb/util/logutil.InitLogger()
      util/logutil/log.go:109 +0x124
  github.com/pingcap/tidb/planner/core_test.TestLongBinaryPlan()
      planner/core/binary_plan_test.go:299 +0x42b
  github.com/pingcap/tidb/domain.(*Domain).LoadSysVarCacheLoop()
      domain/domain.go:1360 +0xa8
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3016 +0x693
  github.com/pingcap/tidb/domain.(*Domain).GetSessionCache()
      domain/sysvar_cache.go:62 +0x59
  github.com/pingcap/tidb/session.(*session).loadCommonGlobalVariablesIfNeeded()
      session/session.go:3277 +0x104
  github.com/pingcap/tidb/session.(*session).ExecuteStmt()
      session/session.go:2125 +0x2a5
  github.com/pingcap/tidb/session.(*session).ExecuteInternal()
      session/session.go:1673 +0x471
  github.com/pingcap/tidb/domain.(*Domain).LoadPrivilegeLoop()
      domain/domain.go:1302 +0x130
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:3009 +0x644
  github.com/pingcap/tidb/testkit.bootstrap()
      testkit/mockstore.go:84 +0xac
  github.com/pingcap/tidb/testkit.CreateMockStoreAndDomain()
      testkit/mockstore.go:69 +0xe9
  github.com/pingcap/tidb/testkit.CreateMockStore()
      testkit/mockstore.go:61 +0x3b1
  github.com/pingcap/tidb/planner/core_test.TestLongBinaryPlan()
      planner/core/binary_plan_test.go:284 +0x58
  testing.tRunner()
      GOROOT/src/testing/testing.go:1446 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1493 +0x47
Previous read at 0x00000a7c18a0 by goroutine 213201:
  github.com/pingcap/tidb/executor.(*ExecStmt).LogSlowQuery()
      executor/adapter.go:1548 +0xfa4
  github.com/pingcap/tidb/executor.(*ExecStmt).FinishExecuteStmt()
      executor/adapter.go:1387 +0x6eb
  github.com/pingcap/tidb/executor.(*ExecStmt).CloseRecordSet()
      executor/adapter.go:1418 +0x50
  github.com/pingcap/tidb/executor.(*recordSet).Close()
      executor/adapter.go:183 +0xbd
  github.com/pingcap/tidb/session.(*execStmtResult).Close()
      session/session.go:2401 +0x6f
  github.com/pingcap/tidb/session.(*session).ExecRestrictedSQL.func1.1()
      session/session.go:2100 +0x4c
  runtime.deferreturn()
      GOROOT/src/runtime/panic.go:476 +0x32
  github.com/pingcap/tidb/session.(*session).withRestrictedSQLExecutor()
      session/session.go:2078 +0x391
  github.com/pingcap/tidb/session.(*session).ExecRestrictedSQL()
      session/session.go:2082 +0x124
  github.com/pingcap/tidb/domain.(*Domain).refreshMDLCheckTableInfo()
      domain/domain.go:644 +0x421
  github.com/pingcap/tidb/domain.(*Domain).loadSchemaInLoop()
      domain/domain.go:794 +0x17b
  github.com/pingcap/tidb/domain.(*Domain).Init.func9()
      domain/domain.go:1041 +0x64
Goroutine 200529 (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
  github.com/pingcap/tidb/testkit/testmain.(*testingM).Run()
      testkit/testmain/wrapper.go:27 +0x42
  go.uber.org/goleak.VerifyTestMain()
      external/org_uber_go_goleak/testmain.go:53 +0x70
  github.com/pingcap/tidb/planner/core.TestMain()
      planner/core/main_test.go:72 +0xc29
  main.main()
      bazel-out/k8-fastbuild/bin/planner/core/core_test_/testmain.go:1532 +0x5e8
Goroutine 213201 (running) created at:
  github.com/pingcap/tidb/domain.(*Domain).Init()
      domain/domain.go:1041 +0x146d
  github.com/pingcap/tidb/session.(*domainMap).Get.func1()
      session/tidb.go:93 +0x749
  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:3154 +0x75
  github.com/pingcap/tidb/session.createSession()
      session/session.go:3150 +0x84
  github.com/pingcap/tidb/session.createSessions()
      session/session.go:3135 +0x6e
  github.com/pingcap/tidb/session.BootstrapSession()
      session/session.go:2976 +0x39e
  github.com/pingcap/tidb/testkit.bootstrap()
      testkit/mockstore.go:84 +0xac
  github.com/pingcap/tidb/testkit.CreateMockStoreAndDomain()
      testkit/mockstore.go:69 +0xe9
  github.com/pingcap/tidb/testkit.CreateMockStore()
      testkit/mockstore.go:61 +0x3b1
  github.com/pingcap/tidb/planner/core_test.TestLongBinaryPlan()
      planner/core/binary_plan_test.go:284 +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)

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.

1 participant