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

*: fix data race in the file of prepare_test.go #7232

Merged
merged 4 commits into from Aug 2, 2018

Conversation

zimulala
Copy link
Contributor

@zimulala zimulala commented Aug 1, 2018

What have you changed? (mandatory)

Fix data race in the file of prepare_test.go

Read at 0x0000028eb742 by goroutine 35:
  github.com/pingcap/tidb/plan.tryFastPlan()
      /home/jenkins/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/plan/point_get_plan.go:117 +0x3e
  github.com/pingcap/tidb/plan.Optimize()
      /home/jenkins/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/plan/optimizer.go:62 +0x77
  github.com/pingcap/tidb/executor.(*Compiler).Compile()
      /home/jenkins/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/compiler.go:48 +0x221
  github.com/pingcap/tidb/session.(*session).execute()
      /home/jenkins/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:807 +0x80f
  github.com/pingcap/tidb/session.(*session).Execute()
      /home/jenkins/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:765 +0x79
  github.com/pingcap/tidb/ddl/util.CompleteDeleteRange()
      /home/jenkins/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/ddl/util/util.go:94 +0x1f9
  github.com/pingcap/tidb/ddl.(*delRange).doTask()
      /home/jenkins/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/ddl/delete_range.go:200 +0x432
  github.com/pingcap/tidb/ddl.(*delRange).doDelRangeWork()
      /home/jenkins/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/ddl/delete_range.go:151 +0x541
  github.com/pingcap/tidb/ddl.(*delRange).doTask()
      /home/jenkins/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/ddl/delete_range.go:200 +0x432
  github.com/pingcap/tidb/ddl.(*delRange).doDelRangeWork()
...

Previous write at 0x0000028eb742 by goroutine 749:
  github.com/pingcap/tidb/executor_test.(*testSuite).TestPreparedNullParam.func1()
      /home/jenkins/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/prepared_test.go:229 +0x3a
  github.com/pingcap/tidb/executor_test.(*testSuite).TestPreparedNullParam()
      /home/jenkins/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/prepared_test.go:259 +0x5d3
  github.com/pingcap/tidb/executor_test.(*testSuite).TestPreparedNullParam()
      /home/jenkins/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/prepared_test.go:256 +0x544
  github.com/pingcap/tidb/executor_test.(*testSuite).TestPreparedNullParam()
      /home/jenkins/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/prepared_test.go:253 +0x4ee
  github.com/pingcap/tidb/executor_test.(*testSuite).TestPreparedNullParam()
      /home/jenkins/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/prepared_test.go:250 +0x43b
  github.com/pingcap/tidb/executor_test.(*testSuite).TestPreparedNullParam()
      /home/jenkins/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/prepared_test.go:249 +0x404
  github.com/pingcap/tidb/executor_test.(*testSuite).TestPreparedNullParam()
    

What is the type of the changes? (mandatory)

  • Improvement (non-breaking change which is an improvement to an existing feature)

How has this PR been tested? (mandatory)

Yes.

Does this PR affect documentation (docs/docs-cn) update? (mandatory)

No.

Does this PR affect tidb-ansible update? (mandatory)

No.

Does this PR need to be added to the release notes? (mandatory)

No.

Refer to a related PR or issue link (optional)

Benchmark result if necessary (optional)

Add a few positive/negative examples (optional)

@zimulala zimulala added the sig/execution SIG execution label Aug 1, 2018
@zimulala
Copy link
Contributor Author

zimulala commented Aug 1, 2018

/run-all-tests

jackysp
jackysp previously approved these changes Aug 2, 2018
Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jackysp jackysp added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 2, 2018
winkyao
winkyao previously approved these changes Aug 2, 2018
Copy link
Contributor

@winkyao winkyao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@winkyao winkyao added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 2, 2018
Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jackysp jackysp merged commit 53ffa17 into pingcap:master Aug 2, 2018
@zimulala zimulala deleted the data-race branch August 2, 2018 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants