Permalink
Please sign in to comment.
Browse files
[SPARK-13747][CORE] Fix potential ThreadLocal leaks in RPC when using…
… 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 <[email protected]> Closes #16230 from zsxwing/fix-SPARK-13747.
- Loading branch information...
Showing
with
23 additions
and 42 deletions.
- +3 −9 core/src/main/scala/org/apache/spark/rpc/RpcTimeout.scala
- +16 −25 core/src/main/scala/org/apache/spark/util/ThreadUtils.scala
- +1 −2 core/src/test/scala/org/apache/spark/rdd/AsyncRDDActionsSuite.scala
- +1 −2 core/src/test/scala/org/apache/spark/scheduler/OutputCommitCoordinatorSuite.scala
- +0 −1 scalastyle-config.xml
- +1 −1 sql/core/src/main/scala/org/apache/spark/sql/execution/basicPhysicalOperators.scala
- +1 −2 sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/BroadcastExchangeExec.scala
0 comments on commit
fb3081d