-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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-3943] Some scripts bin\*.cmd pollutes environment variables in Windows #2797
Conversation
… Windows Modified not to pollute environment variables.
Please merge this AFTER #2796 is merged, because /python/docs/make2.bat will be ignored by .gitignore in /python by mistake. |
Can one of the admins verify this patch? |
ok to test |
|
||
set SPARK_HOME=%~dp0.. | ||
|
||
cmd /V /E /C %SPARK_HOME%\bin\spark-submit.cmd --class org.apache.spark.repl.Main %* spark-shell |
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.
Is the purpose of this file such that exporting SPARK_HOME
here doesn't keep it in the system environment even after the application exits?
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 it is.
Although this script now has only one environment variable SPARK_HOME
, it might be more complicated in future just like bin/spark-shell (linux version), then it might export other environment variables.
I haven't done a close review to make sure this doesn't break anything yet, but the general idea looks good to me. Just so I understand correctly, is the purpose of this to ensure we don't accidentally read environment variables from previous applications that have now exited? Were you observing any strange behavior, or is this just a safeguard for the future? |
QA tests have started for PR 2797 at commit
|
QA tests have finished for PR 2797 at commit
|
Test PASSed. |
@andrewor14 thank you for following this PR. |
I see. This LGTM actually. I just did a closer look at the scripts, and it appears that we already do the same for older ones ( |
Modified not to pollute environment variables.
Just moved the main logic into
XXX2.cmd
fromXXX.cmd
, and callXXX2.cmd
with cmd command inXXX.cmd
.pyspark.cmd
andspark-class.cmd
are already using the same way, butspark-shell.cmd
,spark-submit.cmd
and/python/docs/make.bat
are not.