-
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-49544][CONNECT] Replace coarse-locking in SparkConnectExecutionManager with ConcurrentMap #48034
Conversation
@juliuszsompolski Can you please review this PR too? Thanks! |
...erver/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectExecutionManager.scala
Show resolved
Hide resolved
...erver/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectExecutionManager.scala
Show resolved
Hide resolved
...erver/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectExecutionManager.scala
Show resolved
Hide resolved
...erver/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectExecutionManager.scala
Show resolved
Hide resolved
773a6f0
to
c4d116b
Compare
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.
Thanks for the discussions. It looks good to me.
@hvanhovell @HyukjinKwon Hello Herman and Hyukjin, would you mind merging this PR? Thanks! |
@grundprinzip Hey Martin, can you review and merge this change? Thanks! |
...erver/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectExecutionManager.scala
Outdated
Show resolved
Hide resolved
c4d116b
to
43898ac
Compare
…anager with ConcurrentMap ### What changes were proposed in this pull request? Replace the coarse-locking in SparkConnectSessionManager with ConcurrentMap in order to minimise lock contention when there are many sessions. ### Why are the changes needed? It is a spin-off from #48034 where #48034 addresses many-execution cases whereas this addresses many-session situations. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing test cases. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #48036 from changgyoopark-db/SPARK-49548. Authored-by: Changgyoo Park <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]>
Merged to master. |
…anager with ConcurrentMap ### What changes were proposed in this pull request? Replace the coarse-locking in SparkConnectSessionManager with ConcurrentMap in order to minimise lock contention when there are many sessions. ### Why are the changes needed? It is a spin-off from apache#48034 where apache#48034 addresses many-execution cases whereas this addresses many-session situations. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing test cases. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#48036 from changgyoopark-db/SPARK-49548. Authored-by: Changgyoo Park <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]>
…nManager with ConcurrentMap ### What changes were proposed in this pull request? Replace the coarse-locking mechanism implemented in SparkConnectExecutionManager with ConcurrentMap in order to ameliorate lock contention. ### Why are the changes needed? When there are too many threads, e.g., ~10K threads on a 4-core node, OS scheduling may cause priority inversion that leads to a serious performance problems, e.g., a 1000s delay when reattaching to an execute holder. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing test cases. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#48034 from changgyoopark-db/SPARK-49544. Authored-by: Changgyoo Park <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]>
…anager with ConcurrentMap ### What changes were proposed in this pull request? Replace the coarse-locking in SparkConnectSessionManager with ConcurrentMap in order to minimise lock contention when there are many sessions. ### Why are the changes needed? It is a spin-off from apache#48034 where apache#48034 addresses many-execution cases whereas this addresses many-session situations. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing test cases. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#48036 from changgyoopark-db/SPARK-49548. Authored-by: Changgyoo Park <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]>
…nManager with ConcurrentMap ### What changes were proposed in this pull request? Replace the coarse-locking mechanism implemented in SparkConnectExecutionManager with ConcurrentMap in order to ameliorate lock contention. ### Why are the changes needed? When there are too many threads, e.g., ~10K threads on a 4-core node, OS scheduling may cause priority inversion that leads to a serious performance problems, e.g., a 1000s delay when reattaching to an execute holder. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing test cases. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#48034 from changgyoopark-db/SPARK-49544. Authored-by: Changgyoo Park <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]>
What changes were proposed in this pull request?
Replace the coarse-locking mechanism implemented in SparkConnectExecutionManager with ConcurrentMap in order to ameliorate lock contention.
Why are the changes needed?
When there are too many threads, e.g., ~10K threads on a 4-core node, OS scheduling may cause priority inversion that leads to a serious performance problems, e.g., a 1000s delay when reattaching to an execute holder.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing test cases.
Was this patch authored or co-authored using generative AI tooling?
No.