Skip to content

[MINOR][CORE] Fix self-suppress in TaskResources.runUnsafe error handler#12496

Merged
jackylee-ch merged 1 commit into
apache:mainfrom
LuciferYang:gluten-rununsafe-suppress
Jul 13, 2026
Merged

[MINOR][CORE] Fix self-suppress in TaskResources.runUnsafe error handler#12496
jackylee-ch merged 1 commit into
apache:mainfrom
LuciferYang:gluten-rununsafe-suppress

Conversation

@LuciferYang

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Rename the inner catch (t: Throwable) binding in TaskResources.runUnsafe so it no longer shadows the outer t. The inner catch handles a failure of context.markTaskFailed(t); the intent is to attach that follow-up as a suppressed exception to the original body failure, but the shared name currently makes t.addSuppressed(t) attach the follow-up to itself.

Why are the changes needed?

Pure diagnostic. On a task where the body throws and markTaskFailed also throws, the original exception loses the reference to why cleanup failed. The task still fails with the correct root cause because throw t re-raises the outer t two lines below.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

mvn -pl gluten-core -Pspark-3.5 spotless:check and compile pass. Behavior change is limited to the error-suppression chain on a rare double-failure path; no test added.

Copilot AI review requested due to automatic review settings July 10, 2026 09:32
@LuciferYang

Copy link
Copy Markdown
Contributor Author

cc @jackylee-ch a minor fix

@github-actions github-actions Bot added the CORE works for Gluten Core label Jul 10, 2026
@github-actions

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 outer t.
  • Attach the markTaskFailed failure 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)
@jackylee-ch jackylee-ch merged commit dd512bc into apache:main Jul 13, 2026
137 of 142 checks passed
@LuciferYang

Copy link
Copy Markdown
Contributor Author

Thank you @jackylee-ch @zml1206

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CORE works for Gluten Core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants