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 when invoke Batch #1460

Open
lunny opened this issue Sep 6, 2020 · 3 comments
Open

Data race when invoke Batch #1460

lunny opened this issue Sep 6, 2020 · 3 comments

Comments

@lunny
Copy link

lunny commented Sep 6, 2020

From go-gitea/gitea#1441 (comment)

Bleve Data Race maybe also upstream related.

WARNING: DATA RACE
Write at 0x00c0095ed040 by goroutine 128:
  github.com/blevesearch/bleve/index.(*Batch).Reset()
      /go/src/code.gitea.io/gitea/vendor/github.com/blevesearch/bleve/index/index.go:318 +0x106
  github.com/blevesearch/bleve.(*Batch).Reset()
      /go/src/code.gitea.io/gitea/vendor/github.com/blevesearch/bleve/index.go:119 +0xcc
  github.com/ethantkoenig/rupture.(*singleIndexFlushingBatch).Flush()
      /go/src/code.gitea.io/gitea/vendor/github.com/ethantkoenig/rupture/flushing_batch.go:65 +0xad
  code.gitea.io/gitea/modules/indexer/code.(*BleveIndexer).Index()
      /go/src/code.gitea.io/gitea/modules/indexer/code/bleve.go:266 +0x42c
  code.gitea.io/gitea/modules/indexer/code.(*wrappedIndexer).Index()
      /go/src/code.gitea.io/gitea/modules/indexer/code/wrapped.go:65 +0x122
  code.gitea.io/gitea/modules/indexer/code.index()
      /go/src/code.gitea.io/gitea/modules/indexer/code/queue.go:44 +0x1b1
  code.gitea.io/gitea/modules/indexer/code.processRepoIndexerOperationQueue()
      /go/src/code.gitea.io/gitea/modules/indexer/code/queue.go:61 +0x49d

Previous read at 0x00c0095ed040 by goroutine 58:
  github.com/blevesearch/bleve/index/upsidedown.(*UpsideDownCouch).Batch.func1()
      /go/src/code.gitea.io/gitea/vendor/github.com/blevesearch/bleve/index/upsidedown/upsidedown.go:824 +0x10b
@mschoch
Copy link
Contributor

mschoch commented Sep 8, 2020

This is the first I've heard of ethantkoenig/rupture. It appears to reference a quite old version of bleve in the Gopkg.lock file a3b125508b4443344b596888ca58467b6c9310b9 (Jan 2018)

Can you confirm this is the version being used?

There has been a fix merged to the upsidedown batch reset since then that seems like it might be related:

a91b427#diff-b164f59bc5b495c5ba84a6bc8d13f19c

@lunny
Copy link
Author

lunny commented Sep 8, 2020

@mschoch I think ethantkoenig/ruptur is only a simple wrapper. And in fact, see https://github.com/go-gitea/gitea/blob/master/go.mod, gitea now is using bleve v1.0.10.

I think the data race is between https://github.com/blevesearch/bleve/blob/master/index/upsidedown/upsidedown.go#L823 and https://github.com/blevesearch/bleve/blob/master/index/index.go#L318 .

I will send a PR to try to fix that.

lunny added a commit to lunny/bleve that referenced this issue Sep 8, 2020
@lunny
Copy link
Author

lunny commented Sep 8, 2020

Please review #1461

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants