[SPARK-54565][CORE] SparkBuildInfo should load spark-version-info.properties from its own classloader#53279
Closed
pan3793 wants to merge 2 commits intoapache:masterfrom
Closed
[SPARK-54565][CORE] SparkBuildInfo should load spark-version-info.properties from its own classloader#53279pan3793 wants to merge 2 commits intoapache:masterfrom
spark-version-info.properties from its own classloader#53279pan3793 wants to merge 2 commits intoapache:masterfrom
Conversation
…perties from its own classloader
Member
Author
|
cc @zsxwing as you worked on SPARK-32256 |
Member
Author
|
also cc @LuciferYang and @dongjoon-hyun as this bug affects Connect JDBC driver use cases |
Member
|
Thank you for pinging me, @pan3793 . BTW, given the affected versions, I don't think this is a blocker-level issue. |
Member
Author
|
@dongjoon-hyun, yes, I classify it as a regular bug, not a blocker |
LuciferYang
reviewed
Dec 3, 2025
common/utils/src/main/scala/org/apache/spark/SparkBuildInfo.scala
Outdated
Show resolved
Hide resolved
Co-authored-by: YangJie <yangjie01@baidu.com>
LuciferYang
approved these changes
Dec 3, 2025
LuciferYang
pushed a commit
that referenced
this pull request
Dec 3, 2025
…operties` from its own classloader ### What changes were proposed in this pull request? Change SparkBuildInfo to use its own classloader instead of thread context classloader to load `spark-version-info.properties`. ### Why are the changes needed? I hit an issue during the Connect JDBC driver & JetBrains DataGrip integration. ``` 2025-11-25 18:48:09,475 [ 55114] WARN - #c.i.d.d.BaseDatabaseErrorHandler$MissingDriverClassErrorInfo - Exception org.apache.spark.SparkException: Could not find spark-version-info.properties [in thread "RMI TCP Connection(3)-127.0.0.1"] java.lang.ExceptionInInitializerError: Exception org.apache.spark.SparkException: Could not find spark-version-info.properties [in thread "RMI TCP Connection(3)-127.0.0.1"] at org.apache.spark.SparkBuildInfo$.<clinit>(SparkBuildInfo.scala:35) at org.apache.spark.sql.connect.client.SparkConnectClient$.org$apache$spark$sql$connect$client$SparkConnectClient$$genUserAgent(SparkConnectClient.scala:978) at org.apache.spark.sql.connect.client.SparkConnectClient$Configuration$.apply$default$8(SparkConnectClient.scala:999) at org.apache.spark.sql.connect.client.SparkConnectClient$Builder.<init>(SparkConnectClient.scala:683) at org.apache.spark.sql.connect.client.SparkConnectClient$.builder(SparkConnectClient.scala:676) at org.apache.spark.sql.connect.client.jdbc.SparkConnectConnection.<init>(SparkConnectConnection.scala:31) at org.apache.spark.sql.connect.client.jdbc.NonRegisteringSparkConnectDriver.connect(NonRegisteringSparkConnectDriver.scala:36) at com.intellij.database.remote.jdbc.helpers.JdbcHelperImpl.connect(JdbcHelperImpl.java:786) at com.intellij.database.remote.jdbc.impl.RemoteDriverImpl.connect(RemoteDriverImpl.java:47) ``` After adding some debug messages, I found it was caused by using wrong classloader. ``` c.i.e.r.RemoteProcessSupport - ContextClassLoader: com.intellij.database.remote.jdbc.impl.JdbcClassLoader$1559cc356 c.i.e.r.RemoteProcessSupport - SparkBuildInfo ClassLoader: com.intellij.database.remote.jdbc.impl.JdbcClassLoader$JdbcClassLoaderImpl62e93ea8 ``` Similar issue that affects Hive JDBC driver and Spark's Isolated Classloader (see SPARK-32256) was fixed by [HADOOP-14067](https://issues.apache.org/jira/browse/HADOOP-14067) ### Does this PR introduce _any_ user-facing change? This fixes corner issues that the application uses multiple classloaders with Spark libs. ### How was this patch tested? Pass GHA to ensure the change breaks nothing, also manually verified the Connect JDBC driver & JetBrains DataGrip integration. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #53279 from pan3793/SPARK-54565. Lead-authored-by: Cheng Pan <chengpan@apache.org> Co-authored-by: Cheng Pan <pan3793@gmail.com> Signed-off-by: yangjie01 <yangjie01@baidu.com> (cherry picked from commit 095c2c3) Signed-off-by: yangjie01 <yangjie01@baidu.com>
Contributor
|
Merged into master/branch-4.1. Thanks @pan3793 and @dongjoon-hyun |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Change SparkBuildInfo to use its own classloader instead of thread context classloader to load
spark-version-info.properties.Why are the changes needed?
I hit an issue during the Connect JDBC driver & JetBrains DataGrip integration.
After adding some debug messages, I found it was caused by using wrong classloader.
Similar issue that affects Hive JDBC driver and Spark's Isolated Classloader (see SPARK-32256) was fixed by HADOOP-14067
Does this PR introduce any user-facing change?
This fixes corner issues that the application uses multiple classloaders with Spark libs.
How was this patch tested?
Pass GHA to ensure the change breaks nothing, also manually verified the Connect JDBC driver & JetBrains DataGrip integration.
Was this patch authored or co-authored using generative AI tooling?
No.