Skip to content

SPARK-5425: Use synchronised methods in system properties to create SparkConf #4221

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

Closed

Conversation

jacek-lewandowski
Copy link
Contributor

SPARK-5425: Fixed usages of system properties

This patch fixes few problems caused by the fact that the Scala wrapper over system properties is not thread-safe and is basically invalid because it doesn't take into account the default values which could have been set in the properties object. The problem is fixed by modifying Utils.getSystemProperties method so that it uses stringPropertyNames method of the Properties class, which is thread-safe (internally it creates a defensive copy in a synchronized method) and returns keys of the properties which were set explicitly and which are defined as defaults.
The other related problem, which is fixed here. was in ResetSystemProperties mix-in. It created a copy of the system properties in the wrong way.

This patch also introduces a test case for thread-safeness of SparkConf creation.

Refer to the discussion in #4220 for more details.

@SparkQA
Copy link

SparkQA commented Jan 27, 2015

Test build #26161 has started for PR 4221 at commit 94aeacf.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Jan 27, 2015

Test build #26161 has finished for PR 4221 at commit 94aeacf.

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

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26161/
Test FAILed.

@SparkQA
Copy link

SparkQA commented Jan 29, 2015

Test build #26312 has started for PR 4221 at commit 4a0c50d.

  • This patch merges cleanly.

@jacek-lewandowski
Copy link
Contributor Author

Explanation of the second commit is in #4220

@SparkQA
Copy link

SparkQA commented Jan 29, 2015

Test build #26312 has finished for PR 4221 at commit 4a0c50d.

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

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26312/
Test PASSed.

@SparkQA
Copy link

SparkQA commented Jan 29, 2015

Test build #26321 has started for PR 4221 at commit 01dd5cb.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Jan 29, 2015

Test build #26321 has finished for PR 4221 at commit 01dd5cb.

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

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26321/
Test PASSed.

@SparkQA
Copy link

SparkQA commented Feb 2, 2015

Test build #26498 has started for PR 4221 at commit 87951a2.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Feb 2, 2015

Test build #26498 has finished for PR 4221 at commit 87951a2.

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

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/26498/
Test PASSed.

@JoshRosen
Copy link
Contributor

Let's leave this PR open for a few days until we complete the 1.2.1 release voting, then I'll merge it into branch-1.2 (1.2.2).

@JoshRosen
Copy link
Contributor

Jenkins, retest this please.

@SparkQA
Copy link

SparkQA commented Feb 8, 2015

Test build #27019 has started for PR 4221 at commit 87951a2.

  • This patch merges cleanly.

@JoshRosen
Copy link
Contributor

I'm going to merge this into branch-1.2 (1.2.2) now since I'd like to see if resolves https://issues.apache.org/jira/browse/SPARK-5227.

@SparkQA
Copy link

SparkQA commented Feb 8, 2015

Test build #27019 has finished for PR 4221 at commit 87951a2.

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

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/27019/
Test PASSed.

asfgit pushed a commit that referenced this pull request Feb 8, 2015
…parkConf

SPARK-5425: Fixed usages of system properties

This patch fixes few problems caused by the fact that the Scala wrapper over system properties is not thread-safe and is basically invalid because it doesn't take into account the default values which could have been set in the properties object. The problem is fixed by modifying `Utils.getSystemProperties` method so that it uses `stringPropertyNames` method of the `Properties` class, which is thread-safe (internally it creates a defensive copy in a synchronized method) and returns keys of the properties which were set explicitly and which are defined as defaults.
The other related problem, which is fixed here. was in `ResetSystemProperties` mix-in. It created a copy of the system properties in the wrong way.

This patch also introduces a test case for thread-safeness of SparkConf creation.

Refer to the discussion in #4220 for more details.

Author: Jacek Lewandowski <lewandowski.jacek@gmail.com>

Closes #4221 from jacek-lewandowski/SPARK-5425-1.2 and squashes the following commits:

87951a2 [Jacek Lewandowski] SPARK-5425: Modified Utils.getSystemProperties to return a map of all system properties - explicit + defaults
01dd5cb [Jacek Lewandowski] SPARK-5425: Use SerializationUtils to save properties in ResetSystemProperties trait
94aeacf [Jacek Lewandowski] SPARK-5425: Use synchronised methods in system properties to create SparkConf
@JoshRosen
Copy link
Contributor

I've merged this into branch-1.2 (1.2.2). Thanks!

@jacek-lewandowski, you can close this PR now that it's been merged, since GitHub can't auto close.

@srowen
Copy link
Member

srowen commented Feb 18, 2015

Mind closing this PR @jacek-lewandowski ?

@pwendell
Copy link
Contributor

Yeah our auto-close doesn't work on PR's into release branches like this.

@asfgit asfgit closed this in 46462ff Feb 22, 2015
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.

6 participants