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

domaim/infosync: fix race in test #13899

Merged
merged 10 commits into from
Dec 6, 2019
Merged

Conversation

crazycs520
Copy link
Contributor

What problem does this PR solve?

[2019-12-04T06:48:49.414Z] ==================
[2019-12-04T06:48:49.414Z] WARNING: DATA RACE
[2019-12-04T06:48:49.414Z] Write at 0x000004e9c548 by goroutine 498:
[2019-12-04T06:48:49.414Z]   github.com/pingcap/tidb/domain/infosync.GlobalInfoSyncerInit()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/domain/infosync/info.go:89 +0x2f9
[2019-12-04T06:48:49.415Z]   github.com/pingcap/tidb/domain.(*Domain).Init()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/domain/domain.go:681 +0x624
[2019-12-04T06:48:49.415Z]   github.com/pingcap/tidb/session.(*domainMap).Get.func1()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/tidb.go:78 +0x5bd
[2019-12-04T06:48:49.415Z]   github.com/pingcap/tidb/util.RunWithRetry()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/misc.go:46 +0x90
[2019-12-04T06:48:49.415Z]   github.com/pingcap/tidb/session.(*domainMap).Get()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/tidb.go:70 +0x269
[2019-12-04T06:48:49.415Z]   github.com/pingcap/tidb/session.createSession()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1688 +0x7c
[2019-12-04T06:48:49.415Z]   github.com/pingcap/tidb/session.runInBootstrapSession()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1671 +0x60
[2019-12-04T06:48:49.415Z]   github.com/pingcap/tidb/session.BootstrapSession()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/session/session.go:1588 +0xad3
[2019-12-04T06:48:49.415Z]   github.com/pingcap/tidb/executor_test.(*testBypassSuite).TestLatch()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/write_test.go:2292 +0x18b
[2019-12-04T06:48:49.415Z]   runtime.call32()
[2019-12-04T06:48:49.415Z]       /usr/local/go/src/runtime/asm_amd64.s:539 +0x3a
[2019-12-04T06:48:49.415Z]   reflect.Value.Call()
[2019-12-04T06:48:49.415Z]       /usr/local/go/src/reflect/value.go:321 +0xd3
[2019-12-04T06:48:49.415Z]   github.com/pingcap/check.(*suiteRunner).forkTest.func1()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/pkg/mod/github.com/tiancaiamao/check@v0.0.0-20191119042138-8e73d07b629d/check.go:854 +0x9aa
[2019-12-04T06:48:49.415Z]   github.com/pingcap/check.(*suiteRunner).forkCall.func1()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/pkg/mod/github.com/tiancaiamao/check@v0.0.0-20191119042138-8e73d07b629d/check.go:739 +0x113
[2019-12-04T06:48:49.415Z] 
[2019-12-04T06:48:49.415Z] Previous read at 0x000004e9c548 by goroutine 570:
[2019-12-04T06:48:49.415Z]   github.com/pingcap/tidb/domain/infosync.GetAllServerInfo()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/domain/infosync/info.go:142 +0x3e
[2019-12-04T06:48:49.415Z]   github.com/pingcap/tidb/infoschema.GetTiDBServerInfo()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/infoschema/tables.go:2006 +0x6e
[2019-12-04T06:48:49.415Z]   github.com/pingcap/tidb/infoschema.GetClusterServerInfo()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/infoschema/tables.go:1994 +0x629
[2019-12-04T06:48:49.415Z]   github.com/pingcap/tidb/executor.(*ClusterConfigReader).retrieveClusterConfig()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/cluster_config.go:72 +0x72
[2019-12-04T06:48:49.415Z]   github.com/pingcap/tidb/executor.(*ClusterConfigReader).Next()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/cluster_config.go:51 +0xa4
[2019-12-04T06:48:49.415Z]   github.com/pingcap/tidb/executor.Next()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/executor.go:211 +0x167
[2019-12-04T06:48:49.415Z]   github.com/pingcap/tidb/executor.(*projectionInputFetcher).run()
[2019-12-04T06:48:49.415Z]       /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/executor/projection.go:317 +0x3ed

What is changed and how it works?

Check List

Tests

  • No code

@crazycs520
Copy link
Contributor Author

/run-all-tests

@crazycs520
Copy link
Contributor Author

/run-all-tests

@crazycs520
Copy link
Contributor Author

/run-all-tests

@codecov
Copy link

codecov bot commented Dec 4, 2019

Codecov Report

Merging #13899 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #13899   +/-   ##
===========================================
  Coverage   80.4288%   80.4288%           
===========================================
  Files           480        480           
  Lines        121255     121255           
===========================================
  Hits          97524      97524           
  Misses        16035      16035           
  Partials       7696       7696

@djshow832
Copy link
Contributor

Rest LGTM

domain/infosync/info.go Outdated Show resolved Hide resolved
Copy link
Contributor

@lonng lonng left a comment

Choose a reason for hiding this comment

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

LGTM

@crazycs520
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@djshow832 djshow832 left a comment

Choose a reason for hiding this comment

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

Approve

@crazycs520
Copy link
Contributor Author

/run-all-tests

@crazycs520
Copy link
Contributor Author

/run-common-test

@crazycs520
Copy link
Contributor Author

/run-integration-common-test

@crazycs520
Copy link
Contributor Author

/run-all-tests

@crazycs520
Copy link
Contributor Author

/run-unit-test

@crazycs520 crazycs520 merged commit c723b0b into pingcap:master Dec 6, 2019
XiaTianliang pushed a commit to XiaTianliang/tidb that referenced this pull request Dec 21, 2019
crazycs520 added a commit to lzmhhh123/tidb that referenced this pull request Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants