-
Notifications
You must be signed in to change notification settings - Fork 720
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
schedule: fix datarace in operator.check
(#8264)
#8579
schedule: fix datarace in operator.check
(#8264)
#8579
Conversation
Signed-off-by: husharp <[email protected]>
5675fe3
to
c24f173
Compare
In release 6.5, run test will meet data race only for variable go clean -testcache
go test -timeout 120s -run ^TestOperatorCheckConcurrently$ github.com/tikv/pd/server/schedule/operator -race pingcap@MacBook-Pro-2 ~/CS/PingCAP/pd
cherry-pick-8264-to-release-6.5* $ go test -timeout 120s -run ^TestOperatorCheckConcurrently$ github.com/tikv/pd/server/schedule/operator -race [16:34:24]
==================
WARNING: DATA RACE
Read at 0x00c0000421c8 by goroutine 155:
github.com/tikv/pd/server/schedule/operator.(*Operator).Check()
/Users/pingcap/CS/PingCAP/pd/server/schedule/operator/operator.go:305 +0x418
github.com/tikv/pd/server/schedule/operator.TestOperatorCheckConcurrently.func1()
/Users/pingcap/CS/PingCAP/pd/server/schedule/operator/operator_test.go:511 +0x8c
Previous write at 0x00c0000421c8 by goroutine 163:
??()
-:0 +0x10402a9f4
sync/atomic.CompareAndSwapInt64()
<autogenerated>:1 +0x18
github.com/tikv/pd/server/schedule/operator.TestOperatorCheckConcurrently.func1()
/Users/pingcap/CS/PingCAP/pd/server/schedule/operator/operator_test.go:511 +0x8c
Goroutine 155 (running) created at:
github.com/tikv/pd/server/schedule/operator.TestOperatorCheckConcurrently()
/Users/pingcap/CS/PingCAP/pd/server/schedule/operator/operator_test.go:509 +0x368
testing.tRunner()
/opt/homebrew/opt/go/libexec/src/testing/testing.go:1595 +0x1b0
testing.(*T).Run.func1()
/opt/homebrew/opt/go/libexec/src/testing/testing.go:1648 +0x40
Goroutine 163 (running) created at:
github.com/tikv/pd/server/schedule/operator.TestOperatorCheckConcurrently()
/Users/pingcap/CS/PingCAP/pd/server/schedule/operator/operator_test.go:509 +0x368
testing.tRunner()
/opt/homebrew/opt/go/libexec/src/testing/testing.go:1595 +0x1b0
testing.(*T).Run.func1()
/opt/homebrew/opt/go/libexec/src/testing/testing.go:1648 +0x40
==================
--- FAIL: TestOperatorCheckConcurrently (0.00s) |
Signed-off-by: husharp <[email protected]>
@okJiang: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: HuSharp, lhy1024, okJiang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This is an automated cherry-pick of #8264
What problem does this PR solve?
Issue Number: Close #8263
What is changed and how does it work?
Check List
Tests
go test -timeout 120s -run ^TestOperatorCheckConcurrently$ github.com/tikv/pd/pkg/schedule/operator -race
Release note