Open GoogleCodeExporter opened 9 years ago
Thanks for the catch. I hadn't noticed this as I use a custom BatchExecutor
implementation that manages exceptions on a fiber.
Original comment by peter.royal@pobox.com
on 14 Feb 2012 at 1:25
Looking at your suggested fix, if _commandExecutor is given a buffer with 5
Runnables, and the first one fails, the other 4 will never be run.
This seems bad as well. I'm not sure how to comprehensively address other than
by using a custom BatchExecutor that implements your exception handling policy
Original comment by peter.royal@pobox.com
on 14 Feb 2012 at 1:27
Yes, i known that my fix is no good.
May be a best way it add error handler (like
java.lang.Thread.UncaughtExceptionHandler) and delegate him exception - to
write in log, or other framework user action.
Error handler may be passed into BatchExecutorImpl:
public class BatchExecutorImpl implements BatchExecutor {
private final Errorback errorback;
public void execute(EventReader toExecute) {
for (int i = 0; i < toExecute.size(); i++) {
try {
Runnable runnable = toExecute.get(i);
runnable.run();
} catch(Throwable t) {
errorback.error(runnable, t);
}
}
}
}
Original comment by radio...@ya.ru
on 14 Feb 2012 at 6:04
I second this - misbehaving code is simply a fact of life in larger systems,
and having my actor framework stop working because one component threw an
exception is tricky.
I would prefer something like an UncaughtExceptionHandler interface that I can
set, with the default behaviour being to catch the exception, print it to
stdout, and continue processing events.
Original comment by noelgrandin
on 23 Feb 2012 at 10:08
Original issue reported on code.google.com by
radio...@ya.ru
on 13 Feb 2012 at 7:34