lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Miller <markrmil...@gmail.com>
Subject Re: Interrupting IndexWriter#close(true)
Date Sun, 22 Jul 2012 21:48:59 GMT
https://issues.apache.org/jira/browse/LUCENE-4245 tracks this issue.

On Jul 22, 2012, at 1:15 PM, Mark Miller wrote:

> 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
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

- Mark Miller
lucidimagination.com












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


Mime
View raw message