[ 
https://issues.apache.org/jira/browse/LUCENE-2618?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924150#action_12924150
 ] 

Shai Erera commented on LUCENE-2618:
------------------------------------

OK Mike .I understood the sequence of operations that led to this exception 
before. What didn't add up is why is it thrown during optimize, and not say up 
front when IW is opened, or when the Directory was added through addIndexes.

We should fix the code to throw the exception immediately. Is there a way to 
check a Directory if it's old or not? If not, such exception could really throw 
you off your chair, when you hit it at a point in time not remotely related to 
when it was added to the index.

I don't mind if you continue w/ the fix to the test as you did, but IMO it just 
hides the real problem. I.e., allowing all merges caused by optimize() to 
finish is a correct fix. But catching that exception upon IW.close() is a bad 
one IMO - people who read the code learn how to use Lucene, and catching that 
exception on close() makes absolutely no sense, at least to me. Could you plz 
add a TODO there to get rid of that code when we fix IW to detect old indexes 
up front? That way, if someone reads the code, he'll at least understand that 
this is a temporary solution.

> Intermittent failure in 3.x's backwards TestThreadedOptimize
> ------------------------------------------------------------
>
>                 Key: LUCENE-2618
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2618
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Index
>            Reporter: Michael McCandless
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2618.patch, LUCENE-2618.patch
>
>
> Failure looks like this:
> {noformat}
>     [junit] Testsuite: org.apache.lucene.index.TestThreadedOptimize
>     [junit] Testcase: 
> testThreadedOptimize(org.apache.lucene.index.TestThreadedOptimize):     FAILED
>     [junit] null
>     [junit] junit.framework.AssertionFailedError: null
>     [junit]   at 
> org.apache.lucene.index.TestThreadedOptimize.runTest(TestThreadedOptimize.java:125)
>     [junit]   at 
> org.apache.lucene.index.TestThreadedOptimize.testThreadedOptimize(TestThreadedOptimize.java:149)
>     [junit]   at 
> org.apache.lucene.util.LuceneTestCase.runBare(LuceneTestCase.java:253)
> {noformat}
> I just committed some verbosity so next time it strikes we'll have more 
> details.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to