[SPARK-51691][CORE] SerializationDebugger should swallow exception when try to find the reason of serialization problem#50573
Conversation
core/src/main/scala/org/apache/spark/serializer/SerializationDebugger.scala
Outdated
Show resolved
Hide resolved
|
cc @mridulm |
There was a problem hiding this comment.
We can do this even for non testing case, right ? It will be an improvement over earlier behavior (which would have thrown NPE), and minimize side effects of improveException
There was a problem hiding this comment.
@mridulm Appreciate your time to review
1.NPE have been checked in line#94
2.SPARK-51691 and this follow main resolve the problem, that toString implementation of TreeNode may throw exception since SQLConf.get check during unit test.
Actually non testing case will not encounter similar problem
There was a problem hiding this comment.
NPE I was referring to is what is getting thrown as part of executing toString : what we addressed in #50402
The current reason for NPE might be (2), as you indicated - and so perhaps scoped to Utils.isTesting currently.
But this can happen for any other reason too (including bugs in user udf's for example).
The diff I am proposing is, replace case _: SparkRuntimeException if Utils.isTesting with case _: Exception
I want to make sure this wont cause any other issues.
There was a problem hiding this comment.
Thanks for detailed explanation
I got your point, how about make it case NonFatal(_)
b7c58ed to
23c77b7
Compare
289ebc5 to
4515493
Compare
|
@summaryzb I reopen SPARK-51691, please rebase and submit a complete pr here, thanks |
4515493 to
2e2562d
Compare
|
@LuciferYang done, PTAL |
mridulm
left a comment
There was a problem hiding this comment.
Looks good to me.
+CC @LuciferYang
|
Merged into master. Thanks @summaryzb and @mridulm |
What changes were proposed in this pull request?
Catch
SparkRuntimeExceptionwhen deep into serialization exception stack during unit test.Why are the changes needed?
Present a clearer serialization exception stack hierarchy during test,
toStringimplementation ofTreeNodemay throw exception sinceSQLConf.getcheck. It is helpful for debug the real problemDoes 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
After this pr
How was this patch tested?
Pass GitHub Actions
Was this patch authored or co-authored using generative AI tooling?
No