blevesearch/blevex

panic: send on closed channel using the IndexBatcher

Opened this issue · 6 comments

I'm trying to use the IndexBatcher in this repo and get a panic:

panic: send on closed channel

goroutine 20 [running]:
github.com/blevesearch/bleve/index.AnalysisWorker(0xc4200961e0, 0xc420096240)
	/Users/prologic/go/src/github.com/blevesearch/bleve/index/analysis.go:107 +0x7b
created by github.com/blevesearch/bleve/index.NewAnalysisQueue
	/Users/prologic/go/src/github.com/blevesearch/bleve/index/analysis.go:94 +0xcd

Not really sure what's triggering this yet... Filing here for visibility.

The batcher was contributed by another user, so I don't have much knowledge of the internals. I would start by reviewing this, the line numbers are different, but I believe it's the same panic channel send as this:

blevesearch/bleve#195

This suggests the likely cause is that a Batch is being reused incorrectly somehow

You literally just linked to the same exact issue I found too :) congrats!

Did a quick review and don't see any obvious problem. It looks like after a batch finishes executing, it is reset and then reused, which should be safe. If you have a sample program that can reproduce it that will help.

I do actually! It repros very quickly with a load test using hey -- unfortunately the code is not yet published anywhere you can access; privately hosted atm. If you're keen on helping me debug this we can go offline and I can get you access to the code?

It's not super high priority, but I hate knowing there is an unsolved mystery out there. Let me know what works best for you, you can email me directly at marty.schoch@gmail.com

Thanks!