Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ protected void doCommit(TableMetadata base, TableMetadata metadata) {
io().deleteFile(newMetadataLocation);
}
} catch (RuntimeException e) {
LOG.error("Fail to cleanup metadata file at {}", newMetadataLocation, e);
throw e;
LOG.error("Failed to cleanup metadata file at {}", newMetadataLocation, e);
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you consider adding e as a "suppressed" exception to any previous exception?

It's a bit more refactoring, but often having more information in the thrown exception is more useful than logs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that might be a good option. Let's see what others think

Copy link
Contributor

Choose a reason for hiding this comment

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

I like this option as well. As we lose the CommitFailedException, other than the log... but the exception is the most likely thing to be seen.

But I'd personally wait a bit to see if we hear from somebody at AWS.

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 is fine. If it were easier, I'd opt to suppress the exception (maybe we should consider using runSafely for that) but since this is just warning that a file wasn't cleaned up, the important thing is not to throw.

}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,7 @@ void cleanupMetadataAndUnlock(CommitStatus commitStatus, String metadataLocation
io().deleteFile(metadataLocation);
}
} catch (RuntimeException e) {
LOG.error("Fail to cleanup metadata file at {}", metadataLocation, e);
throw e;
LOG.error("Failed to cleanup metadata file at {}", metadataLocation, e);
} finally {
if (lockManager != null) {
lockManager.release(commitLockEntityId, metadataLocation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,7 @@ private void cleanupMetadataAndUnlock(CommitStatus commitStatus, String metadata
io().deleteFile(metadataLocation);
}
} catch (RuntimeException e) {
LOG.error("Fail to cleanup metadata file at {}", metadataLocation, e);
throw e;
LOG.error("Failed to cleanup metadata file at {}", metadataLocation, e);
} finally {
unlock(lockId);
tableLevelMutex.unlock();
Expand Down