-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[HBASE-22592] : HMaster Construction failure stacktrace to be availab… #311
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
Conversation
…le in .out file - Useful if Logger class is not loaded yet
💔 -1 overall
This message was automatically generated. |
retest this please |
I kicked off another build in case the test failure is unrelated. |
@@ -244,6 +244,7 @@ private int startMaster() { | |||
throw new RuntimeException("HMaster Aborted"); | |||
} | |||
} catch (Throwable t) { | |||
t.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the error be present in the log files with this change? Is there a better way to do this, but still using the logger?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that but as per the screenshot provided in the description, the Exception provided is not available in log file because Logger is not yet loaded.
Anyways, adding printstacktrace() would ensure that the StackTrace is atleast available in .out file. If the Logger is created and loaded by that time, then it would also be present in .log file based on: LOG.error("Master exiting", t);
💔 -1 overall
This message was automatically generated. |
Error not relevant. |
revert
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@apurtell please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't print stuff to stdout if there's a logger available. Please refactor to only print if the logging system isn't present. (which I'm not sure is possible)
@busbey I agree we shouldn't print everything to stdout when logger is available. However, the error present in the screenshot was encountered due to a library that contained some incompatible guava method and HBase had classpath setup to use that library. Hence, when HMaster was started, no error was printed to .log or .out file. We had to attach JDB to figure out this Exception. |
the current patch prints a stack trace to stdout for any throwable. we know there are lots of ways to bring down the master with a throwable that will have a logger in place. Don't print those to stdout. at a minimum you should be adding a catch block for things that are likely to go wrong in a way that can predate a logger being available in the runtime. The stacktrace in your screen shot shows a problem that should not be possible before the logging system is available (it happens in a catch block in an instance method and the logger is a final static variable that should be initialized already before any instances can be created). So please include a reproduction that ensures proper logging configs. |
After updating the dependent library, I am not able to repro this Exception anymore. Tried certain ways but didn't get much progress. |
…le in .out file - Useful if Logger class is not loaded yet
An example of Exception(NoSuchMethodError) which is not present in .log/.out files: