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 memoryStoreCore #44576

Closed
Tracked by #41316
hawkingrei opened this issue Jun 12, 2023 · 0 comments · Fixed by #44577
Closed
Tracked by #41316

DATA RACE in the memoryStoreCore #44576

hawkingrei opened this issue Jun 12, 2023 · 0 comments · Fixed by #44577
Labels
severity/major 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 0x00c0001e7620 by goroutine 7:
  runtime.mapassign_faststr()
      GOROOT/src/runtime/map_faststr.go:203 +0x0
  github.com/pingcap/tidb/timer/api.(*memoryStoreCore).Update()
      timer/api/mem_store.go:136 +0x2f3
  github.com/pingcap/tidb/timer/api.(*defaultTimerClient).CloseTimerEvent()
      timer/api/client.go:189 +0x521
  github.com/pingcap/tidb/timer/runtime.TestTimerFullProcess()
      timer/runtime/runtime_test.go:774 +0x15fd
  testing.tRunner()
      GOROOT/src/testing/testing.go:1576 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1629 +0x47
Previous read at 0x00c0001e7620 by goroutine 8:
  runtime.mapiterinit()
      GOROOT/src/runtime/map.go:815 +0x0
  github.com/pingcap/tidb/timer/api.(*memoryStoreCore).List()
      timer/api/mem_store.go:103 +0x164
  github.com/pingcap/tidb/timer/runtime.(*TimerGroupRuntime).partialRefreshTimers()
      timer/runtime/runtime.go:337 +0x61c
  github.com/pingcap/tidb/timer/runtime.(*TimerGroupRuntime).batchHandleWatchResponses()
      timer/runtime/runtime.go:386 +0x204
  github.com/pingcap/tidb/timer/runtime.(*TimerGroupRuntime).loop()
      timer/runtime/runtime.go:179 +0xcf4
  github.com/pingcap/tidb/timer/runtime.(*TimerGroupRuntime).Start.func2()
      timer/runtime/runtime.go:115 +0x39
Goroutine 7 (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/timer/runtime.TestMain()
      timer/runtime/main_test.go:32 +0x44
  main.main()
      bazel-out/k8-fastbuild/bin/timer/runtime/runtime_test_/testmain.go:136 +0x5e8
Goroutine 8 (running) created at:
  github.com/pingcap/tidb/timer/runtime.(*TimerGroupRuntime).Start()
      timer/runtime/runtime.go:115 +0x1f6
  github.com/pingcap/tidb/timer/runtime.TestTimerFullProcess()
      timer/runtime/runtime_test.go:733 +0xb86
  testing.tRunner()
      GOROOT/src/testing/testing.go:1576 +0x216
  testing.(*T).Run.func1()
      GOROOT/src/testing/testing.go:1629 +0x47
================== 

4. What is your TiDB version? (Required)

@hawkingrei hawkingrei added the type/bug The issue is confirmed as a bug. label Jun 12, 2023
@ti-chi-bot ti-chi-bot bot added may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Jun 12, 2023
@lcwangchao lcwangchao removed may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Jun 12, 2023
ti-chi-bot bot pushed a commit that referenced this issue Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants