[
https://issues.apache.org/jira/browse/LUCENE-5673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13999718#comment-13999718
]
Uwe Schindler commented on LUCENE-5673:
---------------------------------------
The attached patch should bring only the "Map failed". But in any case we can
also hardcode the text, so we can remove the getMessage(). I just wanted to
preserve the original message. The "OutOfMemoryError" comes from the wrapped
exception, but is not part of the message (see FileChannelImpl of Java 7):
{{throw new IOException("Map failed", oome);}}. My code takes the message of
the IOException ("Map failed"), ignores the cause and adds more information
like resourceDescription and the hint "why it failed".
I was thinking about the problem a bit more, we should always add the resource
description, so have 2 exception reformats:
- Change IOExceptions with OOM wrapped to have a hard-coded text "Map failed:
resourceDescription (this may be caused...)"
- All other IOExceptions maybe get the resourceDescription just appended? I am
not sure about this, which is a more general issue of adding
resourceDescription to all IOExceptions our DirectoryImpls throw.
> MmapDirectory shouldn't pass along OOM wrapped as IOException
> -------------------------------------------------------------
>
> Key: LUCENE-5673
> URL: https://issues.apache.org/jira/browse/LUCENE-5673
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Robert Muir
> Attachments: LUCENE-5673.patch, LUCENE-5673.patch, LUCENE-5673.patch
>
>
> The bug here is in java (not MMapDir), but i think we shoudl do something.
> Users get confused when they configure their JVM to trigger something on OOM,
> and then see "OutOfMemoryError: Map Failed": but their trigger doesnt fire.
> Thats because in the jdk, when it maps files it catches OutOfMemoryError,
> asks for a garbage collection, sleeps for 100 milliseconds, then tries to map
> again. if it fails a second time it wraps the OOM in a generic IOException.
> I think we should add a try/catch to our filechannel.map
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]