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 of github.com/benbjohnson/clock #4961

Open
Tracked by #2246
lance6716 opened this issue Mar 21, 2022 · 4 comments
Open
Tracked by #2246

data race of github.com/benbjohnson/clock #4961

lance6716 opened this issue Mar 21, 2022 · 4 comments
Assignees
Labels
component/test Unit tests and integration tests component.

Comments

@lance6716
Copy link
Contributor

Which jobs are flaking?

CDC-UT

Which test(s) are flaking?

pkg/etcd TestWatchChBlocked

Jenkins logs or GitHub Actions link


[2022-03-21T05:53:19.574Z] === FAIL: pkg/etcd TestWatchChBlocked (0.09s)
[2022-03-21T05:53:19.574Z] ==================
[2022-03-21T05:53:19.574Z] WARNING: DATA RACE
[2022-03-21T05:53:19.574Z] Write at 0x00c00077adf8 by goroutine 67:
[2022-03-21T05:53:19.574Z]   github.com/benbjohnson/clock.(*Ticker).Reset()
[2022-03-21T05:53:19.574Z]       /go/pkg/mod/github.com/benbjohnson/[email protected]/clock.go:356 +0x106
[2022-03-21T05:53:19.574Z]   github.com/pingcap/tiflow/pkg/etcd.(*Client).WatchWithChan()
[2022-03-21T05:53:19.574Z]       /home/jenkins/agent/workspace/ut-check/tiflow/pkg/etcd/client.go:270 +0x11cd
[2022-03-21T05:53:19.574Z]   github.com/pingcap/tiflow/pkg/etcd.TestWatchChBlocked.func2()
[2022-03-21T05:53:19.574Z]       /home/jenkins/agent/workspace/ut-check/tiflow/pkg/etcd/client_test.go:190 +0x1b1
[2022-03-21T05:53:19.574Z] 
[2022-03-21T05:53:19.574Z] Previous read at 0x00c00077adf8 by goroutine 65:
[2022-03-21T05:53:19.575Z]   github.com/benbjohnson/clock.(*internalTicker).Tick()
[2022-03-21T05:53:19.575Z]       /go/pkg/mod/github.com/benbjohnson/[email protected]/clock.go:368 +0x93
[2022-03-21T05:53:19.575Z]   github.com/benbjohnson/clock.(*Mock).runNextTimer()
[2022-03-21T05:53:19.575Z]       /go/pkg/mod/github.com/benbjohnson/[email protected]/clock.go:156 +0x1ce
[2022-03-21T05:53:19.575Z]   github.com/benbjohnson/clock.(*Mock).Add()
[2022-03-21T05:53:19.575Z]       /go/pkg/mod/github.com/benbjohnson/[email protected]/clock.go:96 +0x97
[2022-03-21T05:53:19.575Z]   github.com/pingcap/tiflow/pkg/etcd.TestWatchChBlocked()
[2022-03-21T05:53:19.575Z]       /home/jenkins/agent/workspace/ut-check/tiflow/pkg/etcd/client_test.go:197 +0x8ad
[2022-03-21T05:53:19.575Z]   testing.tRunner()
[2022-03-21T05:53:19.575Z]       /usr/local/go/src/testing/testing.go:1439 +0x213
[2022-03-21T05:53:19.575Z]   testing.(*T).Run.func1()
[2022-03-21T05:53:19.575Z]       /usr/local/go/src/testing/testing.go:1486 +0x47
[2022-03-21T05:53:19.575Z] 
[2022-03-21T05:53:19.575Z] Goroutine 67 (running) created at:
[2022-03-21T05:53:19.575Z]   github.com/pingcap/tiflow/pkg/etcd.TestWatchChBlocked()
[2022-03-21T05:53:19.575Z]       /home/jenkins/agent/workspace/ut-check/tiflow/pkg/etcd/client_test.go:189 +0x744
[2022-03-21T05:53:19.575Z]   testing.tRunner()
[2022-03-21T05:53:19.575Z]       /usr/local/go/src/testing/testing.go:1439 +0x213
[2022-03-21T05:53:19.575Z]   testing.(*T).Run.func1()
[2022-03-21T05:53:19.575Z]       /usr/local/go/src/testing/testing.go:1486 +0x47
[2022-03-21T05:53:19.575Z] 
[2022-03-21T05:53:19.575Z] Goroutine 65 (running) created at:
[2022-03-21T05:53:19.575Z]   testing.(*T).Run()
[2022-03-21T05:53:19.575Z]       /usr/local/go/src/testing/testing.go:1486 +0x724
[2022-03-21T05:53:19.575Z]   testing.runTests.func1()
[2022-03-21T05:53:19.575Z]       /usr/local/go/src/testing/testing.go:1839 +0x99
[2022-03-21T05:53:19.575Z]   testing.tRunner()
[2022-03-21T05:53:19.575Z]       /usr/local/go/src/testing/testing.go:1439 +0x213
[2022-03-21T05:53:19.575Z]   testing.runTests()
[2022-03-21T05:53:19.575Z]       /usr/local/go/src/testing/testing.go:1837 +0x7e4
[2022-03-21T05:53:19.575Z]   testing.(*M).Run()
[2022-03-21T05:53:19.575Z]       /usr/local/go/src/testing/testing.go:1719 +0xa71
[2022-03-21T05:53:19.575Z]   go.uber.org/goleak.VerifyTestMain()
[2022-03-21T05:53:19.575Z]       /go/pkg/mod/go.uber.org/[email protected]/testmain.go:53 +0x59
[2022-03-21T05:53:19.575Z]   github.com/pingcap/tiflow/pkg/leakutil.SetUpLeakTest()
[2022-03-21T05:53:19.575Z]       /home/jenkins/agent/workspace/ut-check/tiflow/pkg/leakutil/leak_helper.go:33 +0x3e4
[2022-03-21T05:53:19.575Z]   github.com/pingcap/tiflow/pkg/etcd.TestMain()
[2022-03-21T05:53:19.575Z]       /home/jenkins/agent/workspace/ut-check/tiflow/pkg/etcd/main_test.go:23 +0x404
[2022-03-21T05:53:19.575Z]   main.main()
[2022-03-21T05:53:19.575Z]       _testmain.go:139 +0x3f3
[2022-03-21T05:53:19.575Z] ==================
[2022-03-21T05:53:19.575Z] ==================
[2022-03-21T05:53:19.575Z] WARNING: DATA RACE
[2022-03-21T05:53:19.575Z] Write at 0x00c00077add8 by goroutine 67:
[2022-03-21T05:53:19.575Z]   github.com/benbjohnson/clock.(*Ticker).Reset()
[2022-03-21T05:53:19.575Z]       /go/pkg/mod/github.com/benbjohnson/[email protected]/clock.go:357 +0x194
[2022-03-21T05:53:19.575Z]   github.com/pingcap/tiflow/pkg/etcd.(*Client).WatchWithChan()
[2022-03-21T05:53:19.575Z]       /home/jenkins/agent/workspace/ut-check/tiflow/pkg/etcd/client.go:270 +0x11cd
[2022-03-21T05:53:19.575Z]   github.com/pingcap/tiflow/pkg/etcd.TestWatchChBlocked.func2()
[2022-03-21T05:53:19.575Z]       /home/jenkins/agent/workspace/ut-check/tiflow/pkg/etcd/client_test.go:190 +0x1b1
[2022-03-21T05:53:19.575Z] 
[2022-03-21T05:53:19.575Z] Previous write at 0x00c00077add8 by goroutine 65:
[2022-03-21T05:53:19.575Z]   github.com/benbjohnson/clock.(*internalTicker).Tick()
[2022-03-21T05:53:19.575Z]       /go/pkg/mod/github.com/benbjohnson/[email protected]/clock.go:368 +0xe4
[2022-03-21T05:53:19.575Z]   github.com/benbjohnson/clock.(*Mock).runNextTimer()
[2022-03-21T05:53:19.575Z]       /go/pkg/mod/github.com/benbjohnson/[email protected]/clock.go:156 +0x1ce
[2022-03-21T05:53:19.575Z]   github.com/benbjohnson/clock.(*Mock).Add()
[2022-03-21T05:53:19.575Z]       /go/pkg/mod/github.com/benbjohnson/[email protected]/clock.go:96 +0x97
[2022-03-21T05:53:19.575Z]   github.com/pingcap/tiflow/pkg/etcd.TestWatchChBlocked()
[2022-03-21T05:53:19.575Z]       /home/jenkins/agent/workspace/ut-check/tiflow/pkg/etcd/client_test.go:197 +0x8ad
[2022-03-21T05:53:19.575Z]   testing.tRunner()
[2022-03-21T05:53:19.575Z]       /usr/local/go/src/testing/testing.go:1439 +0x213
[2022-03-21T05:53:19.575Z]   testing.(*T).Run.func1()
[2022-03-21T05:53:19.575Z]       /usr/local/go/src/testing/testing.go:1486 +0x47
[2022-03-21T05:53:19.575Z] 
[2022-03-21T05:53:19.575Z] Goroutine 67 (running) created at:
[2022-03-21T05:53:19.575Z]   github.com/pingcap/tiflow/pkg/etcd.TestWatchChBlocked()
[2022-03-21T05:53:19.576Z]       /home/jenkins/agent/workspace/ut-check/tiflow/pkg/etcd/client_test.go:189 +0x744
[2022-03-21T05:53:19.576Z]   testing.tRunner()
[2022-03-21T05:53:19.576Z]       /usr/local/go/src/testing/testing.go:1439 +0x213
[2022-03-21T05:53:19.576Z]   testing.(*T).Run.func1()
[2022-03-21T05:53:19.576Z]       /usr/local/go/src/testing/testing.go:1486 +0x47
[2022-03-21T05:53:19.576Z] 
[2022-03-21T05:53:19.576Z] Goroutine 65 (running) created at:
[2022-03-21T05:53:19.576Z]   testing.(*T).Run()
[2022-03-21T05:53:19.576Z]       /usr/local/go/src/testing/testing.go:1486 +0x724
[2022-03-21T05:53:19.576Z]   testing.runTests.func1()
[2022-03-21T05:53:19.576Z]       /usr/local/go/src/testing/testing.go:1839 +0x99
[2022-03-21T05:53:19.576Z]   testing.tRunner()
[2022-03-21T05:53:19.576Z]       /usr/local/go/src/testing/testing.go:1439 +0x213
[2022-03-21T05:53:19.576Z]   testing.runTests()
[2022-03-21T05:53:19.576Z]       /usr/local/go/src/testing/testing.go:1837 +0x7e4
[2022-03-21T05:53:19.576Z]   testing.(*M).Run()
[2022-03-21T05:53:19.576Z]       /usr/local/go/src/testing/testing.go:1719 +0xa71
[2022-03-21T05:53:19.576Z]   go.uber.org/goleak.VerifyTestMain()
[2022-03-21T05:53:19.576Z]       /go/pkg/mod/go.uber.org/[email protected]/testmain.go:53 +0x59
[2022-03-21T05:53:19.576Z]   github.com/pingcap/tiflow/pkg/leakutil.SetUpLeakTest()
[2022-03-21T05:53:19.576Z]       /home/jenkins/agent/workspace/ut-check/tiflow/pkg/leakutil/leak_helper.go:33 +0x3e4
[2022-03-21T05:53:19.576Z]   github.com/pingcap/tiflow/pkg/etcd.TestMain()
[2022-03-21T05:53:19.576Z]       /home/jenkins/agent/workspace/ut-check/tiflow/pkg/etcd/main_test.go:23 +0x404
[2022-03-21T05:53:19.576Z]   main.main()
[2022-03-21T05:53:19.576Z]       _testmain.go:139 +0x3f3
[2022-03-21T05:53:19.576Z] ==================

https://ci.pingcap.net/blue/organizations/jenkins/tiflow-verify-go1.18-pipeline/detail/tiflow-verify-go1.18-pipeline/226/pipeline , which belongs to #4949

Anything else we need to know

  • Does this test exist for other branches as well?

  • Has there been a high frequency of failure lately?

@lance6716 lance6716 added the component/test Unit tests and integration tests component. label Mar 21, 2022
@CharlesCheung96
Copy link
Contributor

It looks like a bug inside the github.com/benbjohnson/clock package. Ref: benbjohnson/clock#44

@lance6716
Copy link
Contributor Author

@CharlesCheung96 seems that repo is not active, can we force pin the version to v1.1.0?

@CharlesCheung96
Copy link
Contributor

@CharlesCheung96 seems that repo is not active, can we force pin the version to v1.1.0?

Is there any benefits to pin the version to v1.1.0? BTW, this dependency is relatively small, perhaps we can help them fix the bug.

@wuhuizuo
Copy link
Contributor

It looks like a bug inside the github.com/benbjohnson/clock package. Ref: benbjohnson/clock#44

It's solved. Should we use the version >= v1.3.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/test Unit tests and integration tests component.
Projects
None yet
Development

No branches or pull requests

4 participants