Skip to content

Conversation

@zeodtr
Copy link

@zeodtr zeodtr commented May 28, 2014

This is my attempt to fix https://issues.apache.org/jira/browse/SPARK-1825.

Tested on Windows 7 and Hortonworks HDP 2.1 Sandbox, and it works.
Two more problems reported in SPARK-1825(SPARK_HOME, %HADOOP_MAPRED_HOME%) were gone, perhaps by other commits that took after rc5.

WARNING:
But this fix is Hadoop 2.4.0+ only, since it uses new APIs introduced by https://issues.apache.org/jira/browse/YARN-1824.
So, version checking may be needed, but my knowledge for the Spark source code is limited, so I don't know how to do it.

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you say, this value only appeared in Hadoop 2.4.0:

http://hadoop.apache.org/docs/r2.4.0/api/org/apache/hadoop/yarn/api/ApplicationConstants.html
http://hadoop.apache.org/docs/r2.3.0/api/org/apache/hadoop/yarn/api/ApplicationConstants.html

File.pathSeparator should already be ":" vs ";", which is what you intend right?
http://docs.oracle.com/javase/7/docs/api/java/io/File.html#pathSeparator

I'm missing what this changes then. I understand that the char may vary on the client vs cluster, and that's why it's right to reference a symbolic constant, but these seem to be the same in that respect.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value of ApplicationConstants.CLASS_PATH_SEPARATOR is "<CPS>" - neither ":" nor ";".
The point is that the separator will be chosen by the cluster(in my case, linux machine), rather than the client(in my case, Windows machine) if ApplicationConstants.CLASS_PATH_SEPARATOR is used.
That is, the server hadoop module will find "<CPS>" string in the path string and replace it with the real separator appropriate to its OS.
But current Spark 1.0 code 'hardcodes' the separator on the client side, by using File.pathSeparator. Then the Windows-style path string (that contains ';' which confuses the linux shell script interpreter) will be sent to the linux cluster, in my case.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, maybe this is a 'yarn-client' mode-only problem.
I have not tested the 'yarn-cluster' mode.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I get it. Because the client forms the path but sends it to the server, so it's produced and consumed in different places. The bad news is that you can't use this constant, but, I suppose you can literally specify <CPS>. But will that fail for Hadoop < 2.4?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will fail for Hadoop < 2.4.
The hadoop server code that recognizes <CPS> was committed at Mar 17 2014, to resolve YARN-1824. The code is in org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch. (see this github link)
So, maybe the best solution that does not require Hadoop 2.4.0 is to build the environment variables on the cluster side. (I don't know how to do that - is it even possible?)

@andrewor14
Copy link
Contributor

ok to test

@andrewor14
Copy link
Contributor

@zeodtr Can you update the title to make it something more descriptive?

@SparkQA
Copy link

SparkQA commented Sep 3, 2014

QA tests have started for PR 899 at commit b768fc6.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Sep 3, 2014

QA tests have finished for PR 899 at commit b768fc6.

  • This patch passes unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@zeodtr zeodtr changed the title fixes https://issues.apache.org/jira/browse/SPARK-1825 fixes crossplatform submit problem (see https://issues.apache.org/jira/browse/SPARK-1825) Sep 4, 2014
@zeodtr
Copy link
Author

zeodtr commented Sep 4, 2014

@andrewor14 Updated the title.

@andrewor14
Copy link
Contributor

Sorry, could you update the title to use this format [SPARK-1825] Fixes cross platform...? We use a tool that parses the JIRA number to link Spark PRs with their associated issues. Thanks.

@zeodtr zeodtr changed the title fixes crossplatform submit problem (see https://issues.apache.org/jira/browse/SPARK-1825) [SPARK-1825] Fixes cross-platform submit problem Sep 5, 2014
@zeodtr
Copy link
Author

zeodtr commented Sep 5, 2014

@andrewor14 Updated the title.

@vanzin
Copy link
Contributor

vanzin commented Sep 5, 2014

@zeodtr does this compile with anything < hadoop 2.4? If it doesn't, this is a no-go.

@andrewor14
Copy link
Contributor

@zeodtr Thanks for updating the title. Just so I understand the issue, for HDP 2.1 on Windows we need these changes for Spark to run, is that correct? However, with this patch other hadoop versions < 2.4 won't even compile, so it seems that we need to do figure out which fields to call during runtime through reflection. When you have a chance can you fix this up so it's compatible across other hadoop versions as well?

@andrewor14
Copy link
Contributor

Also, I notice that this is opened against branch-1.0. It would be better if you could open it against the master branch so the latest Spark releases will also benefit from your changes.

@SparkQA
Copy link

SparkQA commented Sep 5, 2014

Can one of the admins verify this patch?

@andrewor14
Copy link
Contributor

ok to test

@SparkQA
Copy link

SparkQA commented Sep 6, 2014

QA tests have started for PR 899 at commit b768fc6.

  • This patch merges cleanly.

@zeodtr
Copy link
Author

zeodtr commented Sep 6, 2014

@andrewor14 @vanzin As I already mentioned in another comment, This won't compile on Hadoop < 2.4. So I suggested another method, but currently I have not enough knowledge to implement the idea.
Sorry if this PR confuses you.

@SparkQA
Copy link

SparkQA commented Sep 6, 2014

QA tests have finished for PR 899 at commit b768fc6.

  • This patch passes unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@andrewor14
Copy link
Contributor

@zeodtr No worries. We can build on top of your patch to make this work for hadoop versions < 2.4. Thanks for digging through this code.

@andrewor14
Copy link
Contributor

Hey @zeodtr I believe this is fixed in #3943 would you mind closing this PR?

@zeodtr
Copy link
Author

zeodtr commented Feb 8, 2015

@andrewor14 Ok, Thanks for fixing!

@zeodtr zeodtr closed this Feb 8, 2015
@andrewor14
Copy link
Contributor

I didn't fix it, @tsudukim did, so thank him :)

agirish pushed a commit to HPEEzmeral/apache-spark that referenced this pull request May 5, 2022
wangyum added a commit that referenced this pull request May 26, 2023
…OOM (#898)

* Fix Driver OOM

* Fix

* Fix

* Fix (#899)

* Update DynamicDataPruningSuite.scala

* Update DynamicDataPruningSuite.scala
udaynpusa pushed a commit to mapr/spark that referenced this pull request Jan 30, 2024
mapr-devops pushed a commit to mapr/spark that referenced this pull request May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants