river-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Firmstone <j...@zeus.net.au>
Subject Re: TaskManager requirements
Date Tue, 13 Jul 2010 11:28:01 GMT
Ok, understood, ANY throwable sounds bad, we should probably pick 
something sensible in the Error / Exception hierarchy, that it and below 
will log the exception, and anything else above isn't caught, but left 
to bubble up the call stack.

Patricia Shanahan wrote:
> On 7/13/2010 1:10 AM, Peter Firmstone wrote:
>> Patricia Shanahan wrote:
>>> I'm getting into writing a new TaskManager, and have a requirements
>>> question. I expect I will have more of them as time goes on.
>>>
>>> TaskManager logs and ignores any Throwable from a Task's run method.
>>>
>>> This troubles me for a couple of reasons. Given the rule that an
>>> interrupt is issued to each Thread during TaskManager termination, I
>>> do not think InterruptedException should be loggable. On the other
>>> hand, should we really be going on running, with just a Level.WARNING
>>> log message, after a really bad JVM problem?
>>>
>>> Patricia
>>>
>> I was thinking about that recently and thought that it should be
>> possible to ask a task it's status. If it has encountered an error, or
>> exception, that could be retrieved, similar to a RunnableFuture. Like
>> you have mentioned, not all exceptions should be caught. Have a look at
>> the comments in JoinManager, there's some interesting comments in there
>> that you might find relevant. If interrupted, it's possible it will be
>> run again.
>
> The Task is a Runnable, and has a Runnable's inherent power to wrap the
> body of its run method in a try-catch. The problem I'm concerned about
> is the handling of disastrous Throwables, such as VirtualMachineError.
> Those are not normally caught, so I would not expect the Task to catch 
> them. A warning log message seems an under-reaction.
>
> I've realized we will never get InterruptedException from calling the
> run method, because it is not an Error or a RuntimeException.
>
> Patricia
>


Mime
View raw message