[
https://issues.apache.org/jira/browse/STORM-712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14384277#comment-14384277
]
ASF GitHub Bot commented on STORM-712:
--------------------------------------
Github user kishorvpatil commented on a diff in the pull request:
https://github.com/apache/storm/pull/468#discussion_r27318086
--- Diff: storm-core/src/jvm/backtype/storm/utils/Utils.java ---
@@ -533,4 +533,16 @@ private static SerializationDelegate
getSerializationDelegate(Map stormConf) {
delegate.prepare(stormConf);
return delegate;
}
+
+ public static void handleUncaughtException(Throwable t) {
+ if(t!= null && t instanceof OutOfMemoryError) {
+ try {
+ System.err.println("Halting due to Out Of Memory Error..." +
Thread.currentThread().getName());
+ } catch (Throwable err) {
+ //Again we done want to exit because of logging issues.
+ }
+ Runtime.getRuntime().halt(-1);
+ }
+ }
--- End diff --
@lazyval, using log interface could rethrow OOM which won't be handled
properly. Hence using `System.err.println`
> Storm daemons must shutdown JVM in case of OOM in any thread
> ------------------------------------------------------------
>
> Key: STORM-712
> URL: https://issues.apache.org/jira/browse/STORM-712
> Project: Apache Storm
> Issue Type: Improvement
> Reporter: Kishor Patil
>
> In case of OutOfMemoryError in any thread, it needs to trigger immediate
> shutdown of the server. I can be done by using
> setDefaultUncaughtExceptionHandler on threads being created.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)