-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-30387] Improving stop hook log message #27049
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
@@ -164,7 +164,7 @@ private[spark] class YarnClientSchedulerBackend( | |||
|
|||
super.stop() | |||
client.stop() | |||
logInfo("Stopped") | |||
logInfo("YarnClientSchedulerBackend Stopped") |
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.
Isn't YarnClientSchedulerBackend
added to full of log message, as in most case the format contains the logger name (mostly same as class name)?
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.
Current log message is
2019-12-27 20:23:26,613 | INFO | [main] | Stopped | org.apache.spark.internal.Logging$class.logInfo(Logging.scala:54)
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.
You must be using a custom logging file because by default you get:
19/12/31 10:47:28 INFO YarnClientSchedulerBackend: Stopped
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.
Look at the spark conf/log4j.properties.template file for the format used there
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.
If true, and I suspect you're right, is there much harm in just adding to the log message anyway?
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.
Also on other places we are using descriptive log message. Like,
spark/core/src/main/scala/org/apache/spark/deploy/ExternalShuffleService.scala
Lines 169 to 171 in ce7a49f
ShutdownHookManager.addShutdownHook { () => | |
logInfo("Shutting down shuffle service.") | |
server.stop() |
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.
no harm, I'm ok with the change, there may just be other places in the code that aren't clear without it so you may want to look at your logging config anyway.
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.
Same as @tgravescs, I think log4j format matters, but agree no harm with this.
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 don't think we should necessarily add it.
because by default you get:
19/12/31 10:47:28 INFO YarnClientSchedulerBackend: Stopped
Also, by default, seems showing the logs fine. Otherwise, we should fix so many places as @tgravescs pointed out. If class names should be shown, that should properly configured for such places.
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.
Yes. as @tgravescs pointed out, here logs can be improved by changing log4j conversion pattern.
Jenkins test this please |
Test build #115993 has finished for PR 27049 at commit
|
@@ -164,7 +164,7 @@ private[spark] class YarnClientSchedulerBackend( | |||
|
|||
super.stop() | |||
client.stop() | |||
logInfo("Stopped") | |||
logInfo("YarnClientSchedulerBackend Stopped") |
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.
@amanomer, why don't you just make the log better just by not using class name directly like the reference you pointed out? e.g.) YARN client scheduler backend stopped
.
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.
@jobitmathew please update the log message.
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.
@amanomer
@HyukjinKwon
@srowen
@tgravescs
changes done as per HyukjinKwon's suggestion.Could you please check.
Test build #4981 has finished for PR 27049 at commit
|
Merged to master |
What changes were proposed in this pull request?
ShutdownHook of YarnClientSchedulerBackend prints just "Stopped" which can be improved to "YarnClientSchedulerBackend Stopped" for better understanding.
Why are the changes needed?
While stopping or gracefully exiting the spark-shell/spark-sql --master yarn, only printing
stopped
is useless.Does this PR introduce any user-facing change?
Yes. Log info message change.
How was this patch tested?
Manually