-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-25174][YARN]Limit the size of diagnostic message for am to unregister itself from rm #22180
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -143,6 +143,7 @@ private[spark] class ApplicationMaster(args: ApplicationMasterArguments) extends | |
| @volatile private var finished = false | ||
| @volatile private var finalStatus = getDefaultFinalStatus | ||
| @volatile private var finalMsg: String = "" | ||
| private val finalMsgLimitSize = sparkConf.get(AM_FINAL_MSG_LIMIT).toInt | ||
| @volatile private var userClassThread: Thread = _ | ||
|
|
||
| @volatile private var reporterThread: Thread = _ | ||
|
|
@@ -368,7 +369,11 @@ private[spark] class ApplicationMaster(args: ApplicationMasterArguments) extends | |
| } | ||
| logInfo(s"Final app status: $finalStatus, exitCode: $exitCode" + | ||
| Option(msg).map(msg => s", (reason: $msg)").getOrElse("")) | ||
| finalMsg = msg | ||
| finalMsg = if (msg == null || msg.length <= finalMsgLimitSize) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's better, thanks |
||
| msg | ||
| } else { | ||
| msg.substring(0, finalMsgLimitSize) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe the message in last |
||
| } | ||
| finished = true | ||
| if (!inShutdown && Thread.currentThread() != reporterThread && reporterThread != null) { | ||
| logDebug("shutting down reporter thread") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -192,6 +192,12 @@ package object config { | |
| .toSequence | ||
| .createWithDefault(Nil) | ||
|
|
||
| private[spark] val AM_FINAL_MSG_LIMIT = ConfigBuilder("spark.yarn.am.finalMessageLimit") | ||
| .doc("The limit size of final diagnostic message for our ApplicationMaster to unregister from" + | ||
| " the ResourceManager.") | ||
| .bytesConf(ByteUnit.BYTE) | ||
| .createWithDefaultString("1m") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for leaving a comment late, and nitpicking but shouldn't we better leave this unlimited by default?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in https://issues.apache.org/jira/browse/YARN-6125 |
||
|
|
||
| /* Client-mode AM configuration. */ | ||
|
|
||
| private[spark] val AM_CORES = ConfigBuilder("spark.yarn.am.cores") | ||
|
|
||
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.
nit: move this to L165? just for code clean.
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.
Better to just read the value at the point where it's needed, given there's only one use.