blevesearch / blevex

Bleve Extensions
47 stars 23 forks source link

panic: send on closed channel using the IndexBatcher #41

Open prologic opened 6 years ago

prologic commented 6 years ago

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.

mschoch commented 6 years ago

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:

https://github.com/blevesearch/bleve/issues/195

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

prologic commented 6 years ago

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

mschoch commented 6 years ago

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.

prologic commented 6 years ago

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?

mschoch commented 6 years ago

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

prologic commented 6 years ago

Thanks!