-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Cancel background Glue partition futures on failure #16418
Cancel background Glue partition futures on failure #16418
Conversation
plugin/trino-hive/src/main/java/io/trino/plugin/hive/metastore/glue/GlueHiveMetastore.java
Show resolved
Hide resolved
7247571
to
aef140e
Compare
@findepi - this change is ready for review, the test failure was caused by a race-prone assertion in |
ec4cd36
to
98ddf48
Compare
98ddf48
to
9034422
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks good to me. However I wonder why ExecutorCompletionService
is necessary? I'm thinking if it would be possible to simply use MoreFutures#allAsListWithCancellationOnFailure
from Airlift?
I think the intention is to allow processing of each future as soon as it's available without waiting for all to complete, and since the sub-futures are not pre-sorted in any meaningful way, we don't need the ordering semantics. |
From offline discussion: @pettyjamesm Pointed out that futures have to be cancelled not only when one of them fails, but also in an event of a planner thread being interrupted |
Description
This change ensures that
GlueHiveMetastore
cancels any ongoing parallel partition loading operations if a failure is encountered in one background thread or if the query is canceled. Previously, these threads would continue to run in the background unnecessarily.Release notes
(x) This is not user-visible or 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: