mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-26 23:07:45 +00:00
Remove dead OOM handling in engine
Previously, the engine would catch an out of memory error and would try to handle the error (it would try to fail the engine, and then it would swallow the out of memory error). Catching the out of memory errors was removed in 3343ceeae44f3d28e3c1ba7861886848df74e390 so this code path is not effectively dead. This commit removes this dead code from the engine. Relates #19881
This commit is contained in:
parent
f547886a9b
commit
1aba907ea2
@ -179,19 +179,6 @@ public final class ExceptionsHelper {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> iff the given throwable is and OutOfMemoryException, otherwise <code>false</code>
|
||||
*/
|
||||
public static boolean isOOM(Throwable t) {
|
||||
return t != null
|
||||
&& (t instanceof OutOfMemoryError
|
||||
|| (t instanceof IllegalStateException
|
||||
&& t.getMessage() != null
|
||||
&& t.getMessage().contains("OutOfMemoryError")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws the specified exception. If null if specified then <code>true</code> is returned.
|
||||
*/
|
||||
|
@ -705,9 +705,6 @@ public abstract class Engine implements Closeable {
|
||||
if (Lucene.isCorruptionException(e)) {
|
||||
failEngine("corrupt file (source: [" + source + "])", e);
|
||||
return true;
|
||||
} else if (ExceptionsHelper.isOOM(e)) {
|
||||
failEngine("out of memory (source: [" + source + "])", e);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user