Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle exceptions while updating credentials better #199

Merged
merged 1 commit into from
Apr 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,22 @@ public void run() {
while (!shutdown.get()) {
try {
updateCredentials();
Thread.sleep(config.getCredentialsRefreshDelay());
} catch (InterruptedException e) {
log.warn("Exception during updateCredentials", e);
//
// If interrupted it's likely the KPL is shutting down. So clear the
// interrupted status and allow the loop to continue.
//
} catch (RuntimeException re) {
log.error(
"Caught runtime exception while updating credentials. Will retry after refresh delay",
re);
}
try {
Thread.sleep(config.getCredentialsRefreshDelay());
} catch (InterruptedException ie) {
//
// Same as above it's likely safe to ignore this as the KPL is probably shutting down.
//
}
}
}
Expand Down