dgraph icon indicating copy to clipboard operation
dgraph copied to clipboard

Race condition while running go test with -race flag

Open janardhan1993 opened this issue 9 years ago • 1 comments

Starting commit routine. [ 1] Writing batch of size: 1

WARNING: DATA RACE Write at 0x0000010ee978 by goroutine 61: github.com/dgraph-io/dgraph/posting.Init() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/lists.go:331 +0x156 github.com/dgraph-io/dgraph/posting.populateGraph() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/index_test.go:164 +0x180 github.com/dgraph-io/dgraph/posting.TestRebuildIndex() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/index_test.go:172 +0x6e testing.tRunner() /usr/local/go/src/testing/testing.go:610 +0xc9

Previous read at 0x0000010ee978 by goroutine 50: github.com/dgraph-io/dgraph/posting.periodicCommit() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/lists.go:221 +0x18f

Goroutine 61 (running) created at: testing.(*T).Run() /usr/local/go/src/testing/testing.go:646 +0x52f testing.RunTests.func1() /usr/local/go/src/testing/testing.go:793 +0xb9 testing.tRunner() /usr/local/go/src/testing/testing.go:610 +0xc9 testing.RunTests() /usr/local/go/src/testing/testing.go:799 +0x4ba testing.(*M).Run() /usr/local/go/src/testing/testing.go:743 +0x12f github.com/dgraph-io/dgraph/posting.TestMain() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/list_test.go:793 +0x3d main.main() github.com/dgraph-io/dgraph/posting/_test/_testmain.go:102 +0x1b5

Goroutine 50 (running) created at: github.com/dgraph-io/dgraph/posting.Init() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/lists.go:335 +0x277 github.com/dgraph-io/dgraph/posting.TestTokensTable() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/index_test.go:86 +0x219 testing.tRunner() /usr/local/go/src/testing/testing.go:610 +0xc9

Starting commit routine.

WARNING: DATA RACE Write at 0x0000010ee9a8 by goroutine 61: github.com/dgraph-io/dgraph/posting.Init() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/lists.go:333 +0x249 github.com/dgraph-io/dgraph/posting.populateGraph() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/index_test.go:164 +0x180 github.com/dgraph-io/dgraph/posting.TestRebuildIndex() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/index_test.go:172 +0x6e testing.tRunner() /usr/local/go/src/testing/testing.go:610 +0xc9

Previous read at 0x0000010ee9a8 by goroutine 51: github.com/dgraph-io/dgraph/posting.batchSync() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/lists.go:469 +0x10a

Goroutine 61 (running) created at: testing.(*T).Run() /usr/local/go/src/testing/testing.go:646 +0x52f testing.RunTests.func1() /usr/local/go/src/testing/testing.go:793 +0xb9 testing.tRunner() /usr/local/go/src/testing/testing.go:610 +0xc9 testing.RunTests() /usr/local/go/src/testing/testing.go:799 +0x4ba testing.(*M).Run() /usr/local/go/src/testing/testing.go:743 +0x12f github.com/dgraph-io/dgraph/posting.TestMain() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/list_test.go:793 +0x3d main.main() github.com/dgraph-io/dgraph/posting/_test/_testmain.go:102 +0x1b5

Goroutine 51 (running) created at: github.com/dgraph-io/dgraph/posting.Init() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/lists.go:336 +0x28f github.com/dgraph-io/dgraph/posting.TestTokensTable() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/index_test.go:86 +0x219 testing.tRunner() /usr/local/go/src/testing/testing.go:610 +0xc9

================== WARNING: DATA RACE Write at 0x00c4209e6e00 by goroutine 40: github.com/dgraph-io/dgraph/algo.Difference() /home/janardhan/go/src/github.com/dgraph-io/dgraph/algo/uidlist.go:334 +0x5de github.com/dgraph-io/dgraph/query.ProcessGraph() /home/janardhan/go/src/github.com/dgraph-io/dgraph/query/query.go:1004 +0x1845

Previous read at 0x00c4209e6e00 by goroutine 76: github.com/dgraph-io/dgraph/algo.(*ListIterator).Seek() /home/janardhan/go/src/github.com/dgraph-io/dgraph/algo/uidlist.go:128 +0x134 github.com/dgraph-io/dgraph/posting.(*List).intersectingPostings.func1() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/list.go:615 +0x107 github.com/dgraph-io/dgraph/posting.(*List).iterate() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/list.go:469 +0x22e github.com/dgraph-io/dgraph/posting.(*List).intersectingPostings() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/list.go:622 +0x22c github.com/dgraph-io/dgraph/posting.(*List).Uids() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/list.go:583 +0xf6 github.com/dgraph-io/dgraph/worker.processTask() /home/janardhan/go/src/github.com/dgraph-io/dgraph/worker/task.go:292 +0x23cc github.com/dgraph-io/dgraph/worker.ProcessTaskOverNetwork() /home/janardhan/go/src/github.com/dgraph-io/dgraph/worker/task.go:48 +0x2ae github.com/dgraph-io/dgraph/query.ProcessGraph() /home/janardhan/go/src/github.com/dgraph-io/dgraph/query/query.go:927 +0x136

Goroutine 40 (running) created at: github.com/dgraph-io/dgraph/query.ProcessGraph() /home/janardhan/go/src/github.com/dgraph-io/dgraph/query/query.go:976 +0x12a0

Goroutine 76 (finished) created at: github.com/dgraph-io/dgraph/query.ProcessGraph() /home/janardhan/go/src/github.com/dgraph-io/dgraph/query/query.go:976 +0x12a0

================== WARNING: DATA RACE Write at 0x00c420872440 by goroutine 40: github.com/dgraph-io/dgraph/algo.Difference() /home/janardhan/go/src/github.com/dgraph-io/dgraph/algo/uidlist.go:340 +0x12e0 github.com/dgraph-io/dgraph/query.ProcessGraph() /home/janardhan/go/src/github.com/dgraph-io/dgraph/query/query.go:1004 +0x1845

Previous read at 0x00c420872440 by goroutine 76: github.com/dgraph-io/dgraph/posting.(*List).intersectingPostings() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/list.go:603 +0x2ce github.com/dgraph-io/dgraph/posting.(*List).Uids() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/list.go:583 +0xf6 github.com/dgraph-io/dgraph/worker.processTask() /home/janardhan/go/src/github.com/dgraph-io/dgraph/worker/task.go:292 +0x23cc github.com/dgraph-io/dgraph/worker.ProcessTaskOverNetwork() /home/janardhan/go/src/github.com/dgraph-io/dgraph/worker/task.go:48 +0x2ae github.com/dgraph-io/dgraph/query.ProcessGraph() /home/janardhan/go/src/github.com/dgraph-io/dgraph/query/query.go:927 +0x136

Goroutine 40 (running) created at: github.com/dgraph-io/dgraph/query.ProcessGraph() /home/janardhan/go/src/github.com/dgraph-io/dgraph/query/query.go:976 +0x12a0

Goroutine 76 (finished) created at: github.com/dgraph-io/dgraph/query.ProcessGraph() /home/janardhan/go/src/github.com/dgraph-io/dgraph/query/query.go:976 +0x12a0

================== WARNING: DATA RACE Write at 0x00c420872488 by goroutine 40: github.com/dgraph-io/dgraph/algo.Difference() /home/janardhan/go/src/github.com/dgraph-io/dgraph/algo/uidlist.go:340 +0x142d github.com/dgraph-io/dgraph/query.ProcessGraph() /home/janardhan/go/src/github.com/dgraph-io/dgraph/query/query.go:1004 +0x1845

Previous read at 0x00c420872488 by goroutine 76: github.com/dgraph-io/dgraph/algo.(*ListIterator).Seek() /home/janardhan/go/src/github.com/dgraph-io/dgraph/algo/uidlist.go:128 +0x87 github.com/dgraph-io/dgraph/posting.(*List).intersectingPostings.func1() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/list.go:615 +0x107 github.com/dgraph-io/dgraph/posting.(*List).iterate() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/list.go:469 +0x22e github.com/dgraph-io/dgraph/posting.(*List).intersectingPostings() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/list.go:622 +0x22c github.com/dgraph-io/dgraph/posting.(*List).Uids() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/list.go:583 +0xf6 github.com/dgraph-io/dgraph/worker.processTask() /home/janardhan/go/src/github.com/dgraph-io/dgraph/worker/task.go:292 +0x23cc github.com/dgraph-io/dgraph/worker.ProcessTaskOverNetwork() /home/janardhan/go/src/github.com/dgraph-io/dgraph/worker/task.go:48 +0x2ae github.com/dgraph-io/dgraph/query.ProcessGraph() /home/janardhan/go/src/github.com/dgraph-io/dgraph/query/query.go:927 +0x136

Goroutine 40 (running) created at: github.com/dgraph-io/dgraph/query.ProcessGraph() /home/janardhan/go/src/github.com/dgraph-io/dgraph/query/query.go:976 +0x12a0

Goroutine 76 (finished) created at: github.com/dgraph-io/dgraph/query.ProcessGraph() /home/janardhan/go/src/github.com/dgraph-io/dgraph/query/query.go:976 +0x12a0

================== WARNING: DATA RACE Write at 0x0000011841b8 by goroutine 58: github.com/dgraph-io/dgraph/posting.Init() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/lists.go:331 +0x156 github.com/dgraph-io/dgraph/worker.initTest() /home/janardhan/go/src/github.com/dgraph-io/dgraph/worker/worker_test.go:108 +0x185 github.com/dgraph-io/dgraph/worker.TestProcessTask() /home/janardhan/go/src/github.com/dgraph-io/dgraph/worker/worker_test.go:116 +0x65 testing.tRunner() /usr/local/go/src/testing/testing.go:610 +0xc9

Previous read at 0x0000011841b8 by goroutine 9: github.com/dgraph-io/dgraph/posting.periodicCommit() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/lists.go:221 +0x18f

Goroutine 58 (running) created at: testing.(*T).Run() /usr/local/go/src/testing/testing.go:646 +0x52f testing.RunTests.func1() /usr/local/go/src/testing/testing.go:793 +0xb9 testing.tRunner() /usr/local/go/src/testing/testing.go:610 +0xc9 testing.RunTests() /usr/local/go/src/testing/testing.go:799 +0x4ba testing.(*M).Run() /usr/local/go/src/testing/testing.go:743 +0x12f github.com/dgraph-io/dgraph/worker.TestMain() /home/janardhan/go/src/github.com/dgraph-io/dgraph/worker/worker_test.go:609 +0x3d main.main() github.com/dgraph-io/dgraph/worker/_test/_testmain.go:64 +0x1b5

Goroutine 9 (running) created at: github.com/dgraph-io/dgraph/posting.Init() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/lists.go:335 +0x277 github.com/dgraph-io/dgraph/worker.initTestBackup() /home/janardhan/go/src/github.com/dgraph-io/dgraph/worker/backup_test.go:63 +0x19e github.com/dgraph-io/dgraph/worker.TestBackup() /home/janardhan/go/src/github.com/dgraph-io/dgraph/worker/backup_test.go:73 +0xa5 testing.tRunner() /usr/local/go/src/testing/testing.go:610 +0xc9

Starting commit routine.

WARNING: DATA RACE Write at 0x0000011841e8 by goroutine 58: github.com/dgraph-io/dgraph/posting.Init() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/lists.go:333 +0x249 github.com/dgraph-io/dgraph/worker.initTest() /home/janardhan/go/src/github.com/dgraph-io/dgraph/worker/worker_test.go:108 +0x185 github.com/dgraph-io/dgraph/worker.TestProcessTask() /home/janardhan/go/src/github.com/dgraph-io/dgraph/worker/worker_test.go:116 +0x65 testing.tRunner() /usr/local/go/src/testing/testing.go:610 +0xc9

Previous read at 0x0000011841e8 by goroutine 10: github.com/dgraph-io/dgraph/posting.batchSync() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/lists.go:469 +0x10a

Goroutine 58 (running) created at: testing.(*T).Run() /usr/local/go/src/testing/testing.go:646 +0x52f testing.RunTests.func1() /usr/local/go/src/testing/testing.go:793 +0xb9 testing.tRunner() /usr/local/go/src/testing/testing.go:610 +0xc9 testing.RunTests() /usr/local/go/src/testing/testing.go:799 +0x4ba testing.(*M).Run() /usr/local/go/src/testing/testing.go:743 +0x12f github.com/dgraph-io/dgraph/worker.TestMain() /home/janardhan/go/src/github.com/dgraph-io/dgraph/worker/worker_test.go:609 +0x3d main.main() github.com/dgraph-io/dgraph/worker/_test/_testmain.go:64 +0x1b5

Goroutine 10 (running) created at: github.com/dgraph-io/dgraph/posting.Init() /home/janardhan/go/src/github.com/dgraph-io/dgraph/posting/lists.go:336 +0x28f github.com/dgraph-io/dgraph/worker.initTestBackup() /home/janardhan/go/src/github.com/dgraph-io/dgraph/worker/backup_test.go:63 +0x19e github.com/dgraph-io/dgraph/worker.TestBackup() /home/janardhan/go/src/github.com/dgraph-io/dgraph/worker/backup_test.go:73 +0xa5 testing.tRunner() /usr/local/go/src/testing/testing.go:610 +0xc9

janardhan1993 avatar Feb 18 '17 10:02 janardhan1993

This has been fixed and merged to master.

pawanrawal avatar Mar 21 '17 01:03 pawanrawal