Skip to content
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-26555][SQL][BRANCH-2.4] make ScalaReflection subtype checking thread safe #24913

Conversation

JoshRosen
Copy link
Contributor

This is a Spark 2.4.x backport of #24085. Original description follows below:

What changes were proposed in this pull request?

Make ScalaReflection subtype checking thread safe by adding a lock. There is a thread safety bug in the <:< operator in all versions of scala (scala/bug#10766).

How was this patch tested?

Existing tests and a new one for the new subtype checking function.

Make ScalaReflection subtype checking thread safe by adding a lock. There is a thread safety bug in the <:< operator in all versions of scala (scala/bug#10766).

Existing tests and a new one for the new subtype checking function.

Closes apache#24085 from mwlon/SPARK-26555.

Authored-by: mwlon <mloncaric@hmc.edu>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
@JoshRosen
Copy link
Contributor Author

JoshRosen commented Jun 19, 2019

This was not a clean cherry-pick: there were a significant number of conflicts in ScalaReflection.scala. To avoid mistakes while resolving conflicts, I opted to pick in the non-conflicting parts and re-implement the rest of the changes via a regex find-replace in IntelliJ (t <:< (.*) => replaced to isSubtype(t, $1) =>) plus a couple of manual edits. I searched to make sure that didn't miss any <:< occurrences.

@SparkQA
Copy link

SparkQA commented Jun 19, 2019

Test build #106685 has finished for PR 24913 at commit 9cc4198.

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

JoshRosen pushed a commit that referenced this pull request Jun 20, 2019
…thread safe

This is a Spark 2.4.x backport of #24085. Original description follows below:

## What changes were proposed in this pull request?

Make ScalaReflection subtype checking thread safe by adding a lock. There is a thread safety bug in the <:< operator in all versions of scala (scala/bug#10766).

## How was this patch tested?

Existing tests and a new one for the new subtype checking function.

Closes #24913 from JoshRosen/joshrosen/SPARK-26555-branch-2.4-backport.

Authored-by: mwlon <mloncaric@hmc.edu>
Signed-off-by: Josh Rosen <rosenville@gmail.com>
@JoshRosen JoshRosen closed this Jun 20, 2019
@JoshRosen JoshRosen deleted the joshrosen/SPARK-26555-branch-2.4-backport branch June 20, 2019 02:08
rluta pushed a commit to rluta/spark that referenced this pull request Sep 17, 2019
…thread safe

This is a Spark 2.4.x backport of apache#24085. Original description follows below:

## What changes were proposed in this pull request?

Make ScalaReflection subtype checking thread safe by adding a lock. There is a thread safety bug in the <:< operator in all versions of scala (scala/bug#10766).

## How was this patch tested?

Existing tests and a new one for the new subtype checking function.

Closes apache#24913 from JoshRosen/joshrosen/SPARK-26555-branch-2.4-backport.

Authored-by: mwlon <mloncaric@hmc.edu>
Signed-off-by: Josh Rosen <rosenville@gmail.com>
kai-chi pushed a commit to kai-chi/spark that referenced this pull request Sep 26, 2019
…thread safe

This is a Spark 2.4.x backport of apache#24085. Original description follows below:

## What changes were proposed in this pull request?

Make ScalaReflection subtype checking thread safe by adding a lock. There is a thread safety bug in the <:< operator in all versions of scala (scala/bug#10766).

## How was this patch tested?

Existing tests and a new one for the new subtype checking function.

Closes apache#24913 from JoshRosen/joshrosen/SPARK-26555-branch-2.4-backport.

Authored-by: mwlon <mloncaric@hmc.edu>
Signed-off-by: Josh Rosen <rosenville@gmail.com>
igreenfield pushed a commit to axiomsl/spark that referenced this pull request Nov 4, 2019
…thread safe

This is a Spark 2.4.x backport of apache#24085. Original description follows below:

## What changes were proposed in this pull request?

Make ScalaReflection subtype checking thread safe by adding a lock. There is a thread safety bug in the <:< operator in all versions of scala (scala/bug#10766).

## How was this patch tested?

Existing tests and a new one for the new subtype checking function.

Closes apache#24913 from JoshRosen/joshrosen/SPARK-26555-branch-2.4-backport.

Authored-by: mwlon <mloncaric@hmc.edu>
Signed-off-by: Josh Rosen <rosenville@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants