merlimat opened a new pull request, #3593: URL: https://github.com/apache/bookkeeper/pull/3593
### Motivation `OrderedExecutor` is taking `SafeRunnable` tasks instead of the standard `Runnable`. The reason was the Java `ThreadPoolExecutor` are failing when an exception is thrown by one of the tasks and there is no log printed of the exception. Right now, this is not needed anymore, because the `SingleThreadExecutor` is already doing try/catch/log: https://github.com/apache/bookkeeper/blob/8ac28db16118e5415c041f8da8cca73777971ce6/bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/SingleThreadExecutor.java#L135 For OrderedScheduler, we can instead wrap the tasks when they are submitted, instead of relying on caller to wrap them. There are a few reasons not to use `SafeRunnable`: 1. It requires 1 extra allocation for each task 2. It makes the API non-standard, pushing the need to always manually wrap the regular `Runnable` 3. Even when using it in lambda-form, it still requires extra levels of indentation that make the code more difficult to read. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
