node-clucene icon indicating copy to clipboard operation
node-clucene copied to clipboard

queries leak filehandles

Open quartzjer opened this issue 13 years ago • 1 comments

https://github.com/erictj/node-clucene/blob/master/src/clucene_bindings.cpp#L586

It looks like it's opening the indexreader twice, and it never closes them... also probably shouldn't re-open one every query?

quartzjer avatar Sep 16 '11 18:09 quartzjer

I think I'm running into problems related to this issue. The example code works fine, but if I run multiple searches in a row, clucene eventually starts throwing errors: read past EOF. My understanding from searching around the net is that this could be a lot of things, but I ruled out index corruption, etc.

If I run var clucene = new cl.Lucene() before each search rather than once at the top of the script, I can get in more searches before clucene starts erroring out. The error message also changes to something more helpful: Too many open files, which is what lead me here.

Anyone have any further thoughts on this?

lhagan avatar Jun 13 '12 14:06 lhagan