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

schedule: fix datarace in operator.check (#8264) #8580

Conversation

ti-chi-bot
Copy link
Member

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

  • Unit test
  • Manual test (add detailed scripts or steps below)
    go test -timeout 120s -run ^TestOperatorCheckConcurrently$ github.com/tikv/pd/pkg/schedule/operator -race
  • in master
==================
WARNING: DATA RACE
Read at 0x00c0004dc240 by goroutine 212:
  github.com/tikv/pd/pkg/schedule/operator.(*Operator).Check()
      /home/lhy1024/pd/pkg/schedule/operator/operator.go:382 +0x5c4
  github.com/tikv/pd/pkg/schedule/operator.TestOperatorCheckConcurrently.func1()
      /home/lhy1024/pd/pkg/schedule/operator/operator_test.go:593 +0xbe

Previous write at 0x00c0004dc240 by goroutine 215:
  sync/atomic.CompareAndSwapInt64()
      /usr/lib/go/src/runtime/race_amd64.s:316 +0xb
  sync/atomic.CompareAndSwapInt64()
      <autogenerated>:1 +0x1a
  github.com/tikv/pd/pkg/schedule/operator.TestOperatorCheckConcurrently.func1()
      /home/lhy1024/pd/pkg/schedule/operator/operator_test.go:593 +0xbe

Goroutine 212 (running) created at:
  github.com/tikv/pd/pkg/schedule/operator.TestOperatorCheckConcurrently()
      /home/lhy1024/pd/pkg/schedule/operator/operator_test.go:591 +0x487
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /usr/lib/go/src/testing/testing.go:1742 +0x44

Goroutine 215 (running) created at:
  github.com/tikv/pd/pkg/schedule/operator.TestOperatorCheckConcurrently()
      /home/lhy1024/pd/pkg/schedule/operator/operator_test.go:591 +0x487
  testing.tRunner()
      /usr/lib/go/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /usr/lib/go/src/testing/testing.go:1742 +0x44
==================
--- FAIL: TestOperatorCheckConcurrently (0.00s)
    testing.go:1398: race detected during execution of test
FAIL
FAIL    github.com/tikv/pd/pkg/schedule/operator        0.103s
FAIL
  • with this pr
ok      github.com/tikv/pd/pkg/schedule/operator        1.098s

Release note

None.

@ti-chi-bot ti-chi-bot added dco-signoff: yes Indicates the PR's author has signed the dco. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-7.5 This PR is cherry-picked to release-7.5 from a source PR. labels Aug 27, 2024
Copy link
Contributor

ti-chi-bot bot commented Aug 27, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign yisaer for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

ti-chi-bot bot commented Aug 27, 2024

@ti-chi-bot: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci/build 247158f link true /test build

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@HuSharp
Copy link
Member

HuSharp commented Aug 27, 2024

has been cherry-picked in #8401

@HuSharp HuSharp closed this Aug 27, 2024
@HuSharp HuSharp deleted the cherry-pick-8264-to-release-7.5 branch August 27, 2024 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. dco-signoff: yes Indicates the PR's author has signed the dco. release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-7.5 This PR is cherry-picked to release-7.5 from a source PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants