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

Introduce initialization exception handler in KCL V2 #369

Merged
merged 10 commits into from
Aug 31, 2018
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,9 @@ public void run() {
try {
initialize();
log.info("Initialization complete. Starting worker loop.");
} catch (RuntimeException e) {
} catch (RuntimeException e) {
log.error("Unable to initialize after {} attempts. Shutting down.", maxInitializationAttempts, e);
workerStateChangeListener.onAllInitializationAttemptsFailed(e);
shutdown();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ enum WorkerState {
}

void onWorkerStateChange(WorkerState newState);

default void onAllInitializationAttemptsFailed(Throwable e) {
}
}