Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch exception in sendUpdate #20202

Merged
merged 1 commit into from
Dec 22, 2023
Merged

Conversation

losipiuk
Copy link
Member

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

@losipiuk
Copy link
Member Author

losipiuk commented Dec 21, 2023

To prevent bug similar to #19997
cc: @nineinchnick

sendUpdateUnsafe();
}
catch (Throwable e) {
fatalUnacknowledgedFailure(new TrinoException(GENERIC_INTERNAL_ERROR, "unexpected error calling sendUpdate()", e));
Copy link
Member

Choose a reason for hiding this comment

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

no need for TrinoException imo
can be just e

try {
sendUpdateUnsafe();
}
catch (Throwable e) {
Copy link
Member

Choose a reason for hiding this comment

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

Can we actually do that holistically? Maybe catch specific section in sendUpdate. It looks like sendUpdate might be touching some state (e.g updateErrorTracker#acquireRequestPermit)

Copy link
Member Author

Choose a reason for hiding this comment

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

IDK what you mean by that

Copy link
Member

Choose a reason for hiding this comment

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

I looked at sendUpdate and it seems it's generally stateless.
I don't think the code after

checkState(currentRequest.getAndSet(future) == null, "There should be no previous request running");
could fail, which seems like the only plance where early method termination would break things.

Catch exception in sendUpdate. Currently in case we get unexpected
exception from that method query would fail as thread responsible for
updating task state will terminate.
@losipiuk losipiuk merged commit 3a31d3a into trinodb:master Dec 22, 2023
@github-actions github-actions bot added this to the 436 milestone Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants