rdblue commented on code in PR #8397:
URL: https://github.com/apache/iceberg/pull/8397#discussion_r1314010173
##########
core/src/main/java/org/apache/iceberg/SnapshotProducer.java:
##########
@@ -436,6 +439,14 @@ public void commit() {
}
}
+ private void cleanupAfterFailure(RuntimeException exception) {
+ if (!strictCleanup || exception instanceof CleanableFailure) {
+ Exceptions.suppressAndThrow(exception, this::cleanAll);
+ }
+
+ throw exception;
Review Comment:
This shouldn't throw an exception. The exception should be thrown from the
calling code so that it is clear when reading that section how execution will
happen. It's fine to pass it in here to determine whether to clean up though.
I'm not sure that this refactoring is worth the method, but it's up to you
once this `throw` is moved back.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]