Skip to content

[SPARK-13747][Core]Fix potential ThreadLocal leaks in RPC when using ForkJoinPool#16230

Closed
zsxwing wants to merge 4 commits into
apache:masterfrom
zsxwing:fix-SPARK-13747
Closed

[SPARK-13747][Core]Fix potential ThreadLocal leaks in RPC when using ForkJoinPool#16230
zsxwing wants to merge 4 commits into
apache:masterfrom
zsxwing:fix-SPARK-13747

Conversation

@zsxwing

@zsxwing zsxwing commented Dec 9, 2016

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

Some places in SQL may call RpcEndpointRef.askWithRetry (e.g., ParquetFileFormat.buildReader -> SparkContext.broadcast -> ... -> BlockManagerMaster.updateBlockInfo -> RpcEndpointRef.askWithRetry), which will finally call Await.result. It may cause java.lang.IllegalArgumentException: spark.sql.execution.id is already set when running in Scala ForkJoinPool.

This PR includes the following changes to fix this issue:

  • Remove ThreadUtils.awaitResult
  • Rename ThreadUtils. awaitResultInForkJoinSafely to ThreadUtils.awaitResult
  • Replace Await.result in RpcTimeout with ThreadUtils.awaitResult.

How was this patch tested?

Jenkins

@zsxwing

zsxwing commented Dec 9, 2016

Copy link
Copy Markdown
Member Author

cc @yhuai since you helped review #15520

@SparkQA

SparkQA commented Dec 9, 2016

Copy link
Copy Markdown

Test build #69910 has started for PR 16230 at commit 68ae0ed.

@SparkQA

SparkQA commented Dec 9, 2016

Copy link
Copy Markdown

Test build #69929 has finished for PR 16230 at commit 1140ee2.

  • This patch fails from timeout after a configured wait of `250m`.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA

SparkQA commented Dec 10, 2016

Copy link
Copy Markdown

Test build #69939 has finished for PR 16230 at commit 2453b8b.

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

@SparkQA

SparkQA commented Dec 10, 2016

Copy link
Copy Markdown

Test build #69950 has finished for PR 16230 at commit 3fade95.

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

@SparkQA

SparkQA commented Dec 10, 2016

Copy link
Copy Markdown

Test build #3486 has finished for PR 16230 at commit 3fade95.

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

@yhuai

yhuai commented Dec 13, 2016

Copy link
Copy Markdown
Contributor

LGTM

@yhuai

yhuai commented Dec 13, 2016

Copy link
Copy Markdown
Contributor

Merging to master

@asfgit asfgit closed this in fb3081d Dec 13, 2016
@zsxwing zsxwing deleted the fix-SPARK-13747 branch December 13, 2016 18:30
asfgit pushed a commit that referenced this pull request Dec 13, 2016
…h 2.1, 2.0)

## What changes were proposed in this pull request?

This PR fixes the timeout value in `awaitResultInForkJoinSafely` for 2.1 and 2.0. Master has been fixed by #16230.

## How was this patch tested?

Jenkins

Author: Shixiong Zhu <shixiong@databricks.com>

Closes #16268 from zsxwing/SPARK-18843.
asfgit pushed a commit that referenced this pull request Dec 13, 2016
…h 2.1, 2.0)

## What changes were proposed in this pull request?

This PR fixes the timeout value in `awaitResultInForkJoinSafely` for 2.1 and 2.0. Master has been fixed by #16230.

## How was this patch tested?

Jenkins

Author: Shixiong Zhu <shixiong@databricks.com>

Closes #16268 from zsxwing/SPARK-18843.

(cherry picked from commit f672bfd)
Signed-off-by: Shixiong Zhu <shixiong@databricks.com>
robert3005 pushed a commit to palantir/spark that referenced this pull request Dec 15, 2016
… ForkJoinPool

## What changes were proposed in this pull request?

Some places in SQL may call `RpcEndpointRef.askWithRetry` (e.g., ParquetFileFormat.buildReader -> SparkContext.broadcast -> ... -> BlockManagerMaster.updateBlockInfo -> RpcEndpointRef.askWithRetry), which will finally call `Await.result`. It may cause `java.lang.IllegalArgumentException: spark.sql.execution.id is already set` when running in Scala ForkJoinPool.

This PR includes the following changes to fix this issue:

- Remove `ThreadUtils.awaitResult`
- Rename `ThreadUtils. awaitResultInForkJoinSafely` to `ThreadUtils.awaitResult`
- Replace `Await.result` in RpcTimeout with `ThreadUtils.awaitResult`.

## How was this patch tested?

Jenkins

Author: Shixiong Zhu <shixiong@databricks.com>

Closes apache#16230 from zsxwing/fix-SPARK-13747.
uzadude pushed a commit to uzadude/spark that referenced this pull request Jan 27, 2017
… ForkJoinPool

## What changes were proposed in this pull request?

Some places in SQL may call `RpcEndpointRef.askWithRetry` (e.g., ParquetFileFormat.buildReader -> SparkContext.broadcast -> ... -> BlockManagerMaster.updateBlockInfo -> RpcEndpointRef.askWithRetry), which will finally call `Await.result`. It may cause `java.lang.IllegalArgumentException: spark.sql.execution.id is already set` when running in Scala ForkJoinPool.

This PR includes the following changes to fix this issue:

- Remove `ThreadUtils.awaitResult`
- Rename `ThreadUtils. awaitResultInForkJoinSafely` to `ThreadUtils.awaitResult`
- Replace `Await.result` in RpcTimeout with `ThreadUtils.awaitResult`.

## How was this patch tested?

Jenkins

Author: Shixiong Zhu <shixiong@databricks.com>

Closes apache#16230 from zsxwing/fix-SPARK-13747.
sumwale pushed a commit to TIBCOSoftware/snappy-spark that referenced this pull request Aug 12, 2021
… ForkJoinPool

## What changes were proposed in this pull request?

Some places in SQL may call `RpcEndpointRef.askWithRetry` (e.g., ParquetFileFormat.buildReader -> SparkContext.broadcast -> ... -> BlockManagerMaster.updateBlockInfo -> RpcEndpointRef.askWithRetry), which will finally call `Await.result`. It may cause `java.lang.IllegalArgumentException: spark.sql.execution.id is already set` when running in Scala ForkJoinPool.

This PR includes the following changes to fix this issue:

- Remove `ThreadUtils.awaitResult`
- Rename `ThreadUtils. awaitResultInForkJoinSafely` to `ThreadUtils.awaitResult`
- Replace `Await.result` in RpcTimeout with `ThreadUtils.awaitResult`.

## How was this patch tested?

Jenkins

Author: Shixiong Zhu <shixiong@databricks.com>

Closes apache#16230 from zsxwing/fix-SPARK-13747.
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.

3 participants