Skip to content

AWS: handle s3 and glue exceptions more gracefully as user errors#5304

Merged
jackye1995 merged 8 commits intoapache:masterfrom
xingfanx:handle_s3_glue_exception
Jul 19, 2022
Merged

AWS: handle s3 and glue exceptions more gracefully as user errors#5304
jackye1995 merged 8 commits intoapache:masterfrom
xingfanx:handle_s3_glue_exception

Conversation

@xingfanx
Copy link
Contributor

@xingfanx xingfanx commented Jul 19, 2022

handle s3 and glue exceptions more gracefully as user errors so it's not being retried indefinitely and causing internal server errors

Tested with unittests

@github-actions github-actions bot added the AWS label Jul 19, 2022
Copy link
Contributor

@amogh-jahagirdar amogh-jahagirdar left a comment

Choose a reason for hiding this comment

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

Thanks! Other than some nit comments, do you mind updating the title and description so it's a bit more clear what we're trying to handle in terms of s3 and glue exception, and why we should handle these exceptions differently then the other Runtime exceptions.

@xingfanx xingfanx changed the title AWS: handle_s3_glue_exception AWS: handle s3 and glue exceptions more gracefully as user errors Jul 19, 2022
@@ -149,6 +150,15 @@ protected void doCommit(TableMetadata base, TableMetadata metadata) {
fullTableName, persistFailure);
commitStatus = checkCommitStatus(newMetadataLocation, metadata);
Copy link
Contributor

Choose a reason for hiding this comment

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

checkCommitStatus is a heavy operation, I think the check of AwsServiceException can happen before that?

Copy link
Contributor

@jackye1995 jackye1995 left a comment

Choose a reason for hiding this comment

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

looks good to me, thanks for the fix!

Copy link
Contributor

@amogh-jahagirdar amogh-jahagirdar left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix!

@jackye1995 jackye1995 merged commit f655c56 into apache:master Jul 19, 2022
fullTableName, persistFailure);
commitStatus = checkCommitStatus(newMetadataLocation, metadata);

if (persistFailure instanceof AwsServiceException) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be a separate catch block to simplify the exception handling flow? like

} catch (AwsServiceException serviceException) {
...
} catch (RuntimeException runtimeException) {
...

@@ -147,7 +148,17 @@ protected void doCommit(TableMetadata base, TableMetadata metadata) {
} catch (RuntimeException persistFailure) {
LOG.error("Confirming if commit to {} indeed failed to persist, attempting to reconnect and check.",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this logging should be moved around since checkCommitStatus is now conditional

singhpk234 pushed a commit to singhpk234/iceberg that referenced this pull request Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants