You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by Chuanlei Ni <ni...@gmail.com> on 2015/07/14 17:39:12 UTC

A question about setup-default-uncaught-exception-handler function

Hi,
   I want to know why setup-default-uncaught-exception-handler just deal
with the OOM error, since the fast fail is the philosophy of Storm design.
When a thread crashes in one Storm process, the process will lost its
functionality mostly.
Why not exit the whole process when an uncaught exception happens? If we
deal exception in that way, we can remove a lot of labor for ops of storm.

Thanks in advance!

Re: A question about setup-default-uncaught-exception-handler function

Posted by Chuanlei Ni <ni...@gmail.com>.
Ok, understand. Thank you very much.

And sorry for the halfheartedness while reading the code!

Thank you again!

2015-07-15 1:17 GMT+08:00 Kishorkumar Patil <kp...@yahoo-inc.com.invalid>:

> Hi Chuanlei,
> The setup-default-uncaught-exception-handler fails fast in both OOM and
> other uncaught Exceptions. The difference in treatment is Runtime.halt vs
> Runtime.exist (Other uncaught exceptions handled here).
>
> If the OOM Error, we shutdown JVM using Runtime.halt. In other cases, we
> call Runtime.exit,  which invokes all registered shutdownhooks, giving
> other parts a chance to gracefully finalize.
>
> Calling Runtime.halt, is extreme caution - as it shutdowns the system
> without calling any shutdownHooks. This extreme steps is essential for OOM
> as attempt to handle that itselt can rethrow more of OOMs.
> So to answer your question in short, we are failing fast - running other
> shutdownhooks or not is the only difference.
>
> -Kishor
>
>
>
>
>
>
>
>      On Tuesday, July 14, 2015 10:40 AM, Chuanlei Ni <ni...@gmail.com>
> wrote:
>
>
>  Hi,
>   I want to know why setup-default-uncaught-exception-handler just deal
> with the OOM error, since the fast fail is the philosophy of Storm design.
> When a thread crashes in one Storm process, the process will lost its
> functionality mostly.
> Why not exit the whole process when an uncaught exception happens? If we
> deal exception in that way, we can remove a lot of labor for ops of storm.
>
> Thanks in advance!
>
>
>
>

Re: A question about setup-default-uncaught-exception-handler function

Posted by Kishorkumar Patil <kp...@yahoo-inc.com.INVALID>.
Hi Chuanlei,
The setup-default-uncaught-exception-handler fails fast in both OOM and other uncaught Exceptions. The difference in treatment is Runtime.halt vs Runtime.exist (Other uncaught exceptions handled here). 

If the OOM Error, we shutdown JVM using Runtime.halt. In other cases, we call Runtime.exit,  which invokes all registered shutdownhooks, giving other parts a chance to gracefully finalize. 

Calling Runtime.halt, is extreme caution - as it shutdowns the system without calling any shutdownHooks. This extreme steps is essential for OOM as attempt to handle that itselt can rethrow more of OOMs.
So to answer your question in short, we are failing fast - running other shutdownhooks or not is the only difference.

-Kishor




 


     On Tuesday, July 14, 2015 10:40 AM, Chuanlei Ni <ni...@gmail.com> wrote:
   

 Hi,
  I want to know why setup-default-uncaught-exception-handler just deal
with the OOM error, since the fast fail is the philosophy of Storm design.
When a thread crashes in one Storm process, the process will lost its
functionality mostly.
Why not exit the whole process when an uncaught exception happens? If we
deal exception in that way, we can remove a lot of labor for ops of storm.

Thanks in advance!