-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bubble Throwables when executing Runnables
This change updates calls to ExecutorService.submit (mostly deamons), to call ExecutorService.execute instead. The submit variant returns a Future which will contain any errors that are thrown from the Runnable. However, nothing was checking these throwables for errors. If an error happens, for example an OutOfMemoryError or RuntimeException thrown from a custom AWSCredentialsProvider, the deamon thread will die without ever logging any error information. Changing this to use execute allows the Thread's UncaughtExceptionHandler or the default UncaughtExceptionHandler to properly handle the failure. At a minimum this allows the error to be logged. Some clients may wish to respond to an OutOfMemoryError by taking a more severe action, such as restaring the service. Given that failure of these deamon threads will likely wedge the KPL, some retry logic or a hard shutdown should probably be implemented in a subsequent commit.
- Loading branch information
1 parent
46340d9
commit 753312f
Showing
2 changed files
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters