karanmehta93 commented on a change in pull request #2173: Call exceptionHandler
if Bookie.start fails with exception.
URL: https://github.com/apache/bookkeeper/pull/2173#discussion_r333788371
##########
File path:
bookkeeper-common/src/main/java/org/apache/bookkeeper/common/component/ComponentStarter.java
##########
@@ -72,6 +73,8 @@ public void run() {
// register a component exception handler
component.setExceptionHandler((t, e) -> {
+ log.error("Triggered exceptionHandler of Component: {} because of
Exception in Thread: {}",
Review comment:
> All we should care about is 'atleast-once' semantics. As long as
'shutdownHookThread' is executed once we should be fine.
Yes this is not a major concern, all I was saying was that it would throw a
bunch of `IllegalThreadStateException` at the end of logs, which can be
potentially confusing.
> Anyhow in LifecycleComponentStack.start Components are started
sequentially, so multiple of them failing at the same time is not going to
happen.
It's not just during the start. Since we are passing the handler to the
component, component may trigger it anytime during its lifecycle. It's OK to be
not overthink much about it for now.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services