-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HADOOP-17295 Move dedicated pre-logging statements into existing logg… #2358
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
base: trunk
Are you sure you want to change the base?
Conversation
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.
This is potentially useful, though you should know we are scared of giant patches which span everything -they make backporting really hard. package-by-package would be better.
- a lot of the old logging was based on commons-logging APIs, there's a lot of concatenation there.
- toString() calls in logging is also needless and expensive, e.g
LOG.debug("status ={}", status.toString())
- needless operations before logging matter most for debug logging, as it is usually off by default. info/warn/error we don't need to guard
- At the same time, what matters there, especially for info, is probably the cost of the evaluation: its the cost of the toString and other calls which would be most beneficial
...anager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/DefaultContainerExecutor.java
Outdated
Show resolved
Hide resolved
...project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
Outdated
Show resolved
Hide resolved
@steveloughran Appreciate your review. Your comment on the logging overhead is valuable for me. I have another question that I would like to hear your thoughts. Do you prefer to reduce accumulated overhead or average overhead? The point is that some simple logging calls are on the hot path and frequently executed. The accumulated overhead for these simple logging calls is larger than other complex logging calls rarely executed. |
💔 -1 overall
This message was automatically generated. |
personally
|
catching up on my long-neglected review homework. @ccoder-chenzhi can you rebase this to trunk? |
ea7ff2b
to
f8e6423
Compare
@steveloughran This PR is rebased to trunk and ready for merge. |
💔 -1 overall
This message was automatically generated. |
I find some cases where some pre-processing statements dedicated to logging calls are not guarded by existing logging guards. Most of them are easy to fix. And the performance and maintainability of these logging calls can be improved to some extend. So I create this PR to fix them. I guess there is no need to add new test cases.
These issues are detected by a static analysis tool wrote by myself. This tool can extract all the dedicated statements for each debug-logging calls (i.e., the results of these statements are only used by debug-logging calls). Because I realize that debug logs will incur overhead in production, such as string concatenation and method calls in the parameters of logging calls. And I want to perform a systematic evaluation for the overhead of debugging logging calls in production.