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
[SPARK-15273] YarnSparkHadoopUtil#getOutOfMemoryErrorArgument should respect OnOutOfMemoryError parameter given by user #13057
Conversation
…fMemoryError parameter given by user
Test build #58397 has finished for PR 13057 at commit
|
Test build #58398 has finished for PR 13057 at commit
|
Test build #58400 has finished for PR 13057 at commit
|
if (Utils.isWindows) { | ||
escapeForShell("-XX:OnOutOfMemoryError=taskkill /F /PID %%%%p") | ||
} else { | ||
"-XX:OnOutOfMemoryError='kill %p'" | ||
val onOOME = javaOpts.find(x => x.contains("-XX:OnOutOfMemoryError")) | ||
if (onOOME == None) { |
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.
There are several things wrong with this Scala code, but more generally, this isn't a good way to design this method. If you really mean to optionally add an argument, then see how things like the PermGen argument are handled and make it work more that way.
Test build #58483 has finished for PR 13057 at commit
|
Test build #58485 has finished for PR 13057 at commit
|
Test build #58486 has finished for PR 13057 at commit
|
Test build #58487 has started for PR 13057 at commit |
i will retrigger this build once maintenance is over. |
@srowen Thanks |
@@ -418,11 +420,11 @@ object YarnSparkHadoopUtil { | |||
* | |||
* @return The correct OOM Error handler JVM option, platform dependent. | |||
*/ | |||
def getOutOfMemoryErrorArgument: String = { | |||
def getOutOfMemoryErrorArgument(sparkConf: SparkConf, javaOpts: ListBuffer[String]): String = { |
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 doesn't need sparkConf as an arg right? and javaOpts can just be a Seq?
jenkins, test this please |
1 similar comment
jenkins, test this please |
Test build #58498 has finished for PR 13057 at commit
|
@srowen Thanks |
Test build #58562 has finished for PR 13057 at commit
|
Test build #58568 has finished for PR 13057 at commit
|
@srowen Cheers |
@srowen |
@srowen |
@@ -334,6 +334,18 @@ static void addPermGenSizeOpt(List<String> cmd) { | |||
} | |||
|
|||
/** | |||
* Gets the OutOfMemoryError option for Spark if the user hasn't set it. | |||
*/ | |||
public static void addOutOfMemoryErrorArgument(List<String> cmd) { |
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.
Sorry last question -- why does this method need to be in this class? it's not used, it seems, except from YarnSparkHadoopUtil
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.
Please suggest a suitable class which is better host for this Java method.
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.
Just YarnSparkHadoopUtil ? it can be inlined the one place it's called or am I overlooking something?
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.
YarnSparkHadoopUtil is written in Scala while this method is in Java.
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.
Why can't it be written in Scala?
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.
Can you take a look at my initial attempt ?
+ val = onOOME = javaOpts.find(x => x.contains("-XX:OnOutOfMemoryError"))
+ if (onOOME == None) {
+ "-XX:OnOutOfMemoryError='kill %p'"
+ } else {
+ ""
+ }
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.
Sure, maybe ...
if (!javaOpts.exists(_.contains("...")) {
javaOpts.add("...")
}
Test build #58707 has finished for PR 13057 at commit
|
Test build #58703 has finished for PR 13057 at commit
|
Test build #58709 has finished for PR 13057 at commit
|
@@ -128,6 +128,11 @@ private[yarn] class ExecutorRunnable( | |||
} | |||
} | |||
|
|||
// Kill if OOM is raised - leverage yarn's failure handling to cause rescheduling. |
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 should be a comment on addOutOfMemoryErrorArgument
right? that's what I meant.
Test build #58778 has finished for PR 13057 at commit
|
@srowen |
@srowen |
if (Utils.isWindows) { | ||
escapeForShell("-XX:OnOutOfMemoryError=taskkill /F /PID %%%%p") | ||
if (!javaOpts.exists(_.contains("-XX:OnOutOfMemoryError"))) { |
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.
OK, but this duplicates the condition. You probably want to flip the nesting of the if conditions here to avoid it
Test build #58995 has finished for PR 13057 at commit
|
@srowen : Thanks |
@tedyu yes, but that's a lot of pinging. I think many iterations on this simple change could have been saved, so I'd focus not on hurrying to merge, but thinking through the feedback and changes you're making more holistically. |
…respect OnOutOfMemoryError parameter given by user ## What changes were proposed in this pull request? As Nirav reported in this thread: http://search-hadoop.com/m/q3RTtdF3yNLMd7u YarnSparkHadoopUtil#getOutOfMemoryErrorArgument previously specified 'kill %p' unconditionally. We should respect the parameter given by user. ## How was this patch tested? Existing tests Author: tedyu <yuzhihong@gmail.com> Closes #13057 from tedyu/master. (cherry picked from commit 06c9f52) Signed-off-by: Sean Owen <sowen@cloudera.com>
Merged to master/2.0 |
What changes were proposed in this pull request?
As Nirav reported in this thread:
http://search-hadoop.com/m/q3RTtdF3yNLMd7u
YarnSparkHadoopUtil#getOutOfMemoryErrorArgument previously specified 'kill %p' unconditionally.
We should respect the parameter given by user.
How was this patch tested?
Existing tests