Currently, interrupting IndexWriter#close(true) - which should wait for 
background merges to finish - causes #close to return while background merges 
are still running.

There is a test that fails occasionally because of this. This is because it's 
using logic like this:

try {
  IndexWriter#close(true)
} finally {
  Directory#close();
}

Background merges will still try and use that directory though. Part of wanting 
to wait for them to finish is so that you know when it's safe to close the 
directory.

So what is the proper way to address this?

Merge threads that throw an exception - even if it's harmless - will fail the 
test framework.

Should Lucene act differently? Should #close not be interruptible? Should it 
make sure merge threads are killed before it bails on interrupt?

Or should the test framework be able to ignore some background thread 
exceptions?

Or is there some option I'm missing?

- Mark Miller
lucidimagination.com












---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to