lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-2511) OutOfMemoryError should not be wrapped in an IllegalStateException, as it is misleading for fault-tolerant programs
Date Fri, 25 Jun 2010 09:39:51 GMT

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

Uwe Schindler commented on LUCENE-2511:
---------------------------------------

As Mike said, your indexing code should have got an OOM and then it knows there is something
wrong and shutdown. To not corrupt the index, we need to detect OOMs. The OOM is rethrowed
after marking IW as "bad", so all is fine, we don't change the exception flow, we just plug
into the exception bubble-up. The Exception you are talking about is an exception coming later
after the OOM was already thrown, to indicate, that you used IW incorrect (calling commit
after OOM).

The OOM causes IndexWriter to get into an illegal state, so the exception is correct. You
are informed about this illegal state when you call commit(). As you should have got an OOM
before, you know, that any further usage of IW is an error, so the ISE is correct. This is
just to prevent incorrect code that calls commit() after an OOM was catched and corrupt the
on-disk index.

> OutOfMemoryError should not be wrapped in an IllegalStateException, as it is misleading
for fault-tolerant programs
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-2511
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2511
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Index
>    Affects Versions: 2.4.1
>            Reporter: David Sitsky
>            Priority: Minor
>
> I have a program, which does explicit commits.  On one occasion, I saw the following
exception thrown:
> java.lang.IllegalStateException: this writer hit an OutOfMemoryError; cannot commit
> at org.apache.lucene.index.IndexWriter.prepareCommit(IndexWriter.java:4061)
> at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:4136)
> at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:4114)
> In our program, we treat all errors as fatal and terminate the program (and restart).
 Runtime exceptions are sometimes handled differently, since they are usually indicative of
a programming bug that might be recoverable. in some situations.
> I think the OutOfMemoryError should not be wrapped as a runtime exception.. as this can
mask a serious issue from a fault-tolerant application.

-- 
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-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message