You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPARK-51691][CORE][TESTS] SerializationDebugger should swallow exception when try to find the reason of serialization problem
### What changes were proposed in this pull request?
Catch `SparkRuntimeException` when deep into serialization exception stack during unit test.
### Why are the changes needed?
Present a clearer serialization exception stack hierarchy during test, `toString` implementation of `TreeNode` may throw exception since `SQLConf.get` check. It is helpful for debug the real problem
### Does this PR introduce _any_ user-facing change?
Yes, but it only take effect in unit test.
User will see the direct serialization exception and the reference chain beyond the root cause.
Before this pr, user will get confuse when unrelated exception is shown
```
WARN org.apache.spark.serializer.SerializationDebugger: Exception in serialization debugger
org.apache.spark.SparkRuntimeException: Cannot get SQLConf inside scheduler event loop thread.
at org.apache.spark.sql.errors.QueryExecutionErrors$.cannotGetSQLConfInSchedulerEventLoopThreadError(QueryExecutionErrors.scala:2002)
at org.apache.spark.sql.internal.SQLConf$.get(SQLConf.scala:225)
at org.apache.spark.sql.execution.ScalarSubquery.toString(subquery.scala:69)
at java.lang.String.valueOf(String.java:2994)
at scala.collection.mutable.StringBuilder.append(StringBuilder.scala:203)
at scala.collection.immutable.Stream.addString(Stream.scala:701)
at scala.collection.TraversableOnce.mkString(TraversableOnce.scala:377)
org.apache.spark.SparkException: Job aborted due to stage failure: Task not serializable: java.io.NotSerializableException:
org.apache.spark.SimpleFutureAction
```
After this pr
```
org.apache.spark.SparkException: Job aborted due to stage failure: Task not serializable: java.io.NotSerializableException: org.apache.spark.SimpleFutureAction
Serialization stack:
- object not serializable (class: org.apache.spark.SimpleFutureAction, value: org.apache.spark.SimpleFutureAction4050649d)
- writeObject data (class: java.util.concurrent.ConcurrentHashMap)
- object (class java.util.concurrent.ConcurrentHashMap)
....(not shown)
```
### How was this patch tested?
Pass GitHub Actions
### Was this patch authored or co-authored using generative AI tooling?
No
Closes#50489 from summaryzb/SPARK-51691.
Authored-by: summaryzb <summaryzb@gmail.com>
Signed-off-by: yangjie01 <yangjie01@baidu.com>
0 commit comments