[MINOR][CORE] Fix self-suppress in TaskResources.runUnsafe error handler#12496
Merged
Merged
Conversation
Contributor
Author
|
cc @jackylee-ch a minor fix |
jackylee-ch
approved these changes
Jul 10, 2026
|
Run Gluten Clickhouse CI on x86 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an exception-suppression bug in TaskResources.runUnsafe’s error-handling path by renaming the inner catch binding so it no longer shadows the original thrown exception, ensuring the secondary failure from context.markTaskFailed(...) is attached as a suppressed exception to the original failure (instead of attempting self-suppression).
Changes:
- Rename the inner
catch (t: Throwable)variable to avoid shadowing the outert. - Attach the
markTaskFailedfailure as a suppressed exception on the original exception (t.addSuppressed(markFailure)).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+107
to
+108
| case markFailure: Throwable => | ||
| t.addSuppressed(markFailure) |
zml1206
approved these changes
Jul 13, 2026
Contributor
Author
|
Thank you @jackylee-ch @zml1206 |
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?
Rename the inner
catch (t: Throwable)binding inTaskResources.runUnsafeso it no longer shadows the outert. The inner catch handles a failure ofcontext.markTaskFailed(t); the intent is to attach that follow-up as a suppressed exception to the original body failure, but the shared name currently makest.addSuppressed(t)attach the follow-up to itself.Why are the changes needed?
Pure diagnostic. On a task where the body throws and
markTaskFailedalso throws, the original exception loses the reference to why cleanup failed. The task still fails with the correct root cause becausethrow tre-raises the outerttwo lines below.Does this PR introduce any user-facing change?
No.
How was this patch tested?
mvn -pl gluten-core -Pspark-3.5 spotless:checkandcompilepass. Behavior change is limited to the error-suppression chain on a rare double-failure path; no test added.