RussellSpitzer commented on code in PR #4687:
URL: https://github.com/apache/iceberg/pull/4687#discussion_r867048887
##########
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/source/SparkWrite.java:
##########
@@ -196,24 +199,33 @@ private void commitOperation(SnapshotUpdate<?> operation,
String description) {
}
long start = System.currentTimeMillis();
- operation.commit(); // abort is automatically called if this fails
- long duration = System.currentTimeMillis() - start;
- LOG.info("Committed in {} ms", duration);
+ try {
+ operation.commit(); // abort is automatically called if this fails
+ long duration = System.currentTimeMillis() - start;
+ LOG.info("Committed in {} ms", duration);
+ } catch (CommitStateUnknownException commitStateUnknownException) {
Review Comment:
This is our current doc for the underlying commit function
```
* Implementations must throw a {@link
org.apache.iceberg.exceptions.CommitStateUnknownException}
* in cases where it cannot be determined if the commit succeeded or
failed.
* For example if a network partition causes the confirmation of the
commit to be lost,
* the implementation should throw a CommitStateUnknownException. This is
important because downstream users of
* this API need to know whether they can clean up the commit or not, if
the state is unknown then it is not safe
* to remove any files. All other exceptions will be treated as if the
commit has failed.
```
--
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]