singhpk234 commented on code in PR #12818:
URL: https://github.com/apache/iceberg/pull/12818#discussion_r2051963314


##########
core/src/main/java/org/apache/iceberg/rest/RESTTableOperations.java:
##########
@@ -155,13 +158,21 @@ public void commit(TableMetadata base, TableMetadata 
metadata) {
     // the error handler will throw necessary exceptions like 
CommitFailedException and
     // UnknownCommitStateException
     // TODO: ensure that the HTTP client lib passes HTTP client errors to the 
error handler
-    LoadTableResponse response =
-        client.post(path, request, LoadTableResponse.class, headers, 
errorHandler);
+    try {
+      LoadTableResponse response =
+          client.post(path, request, LoadTableResponse.class, headers, 
errorHandler);
+      // all future commits should be simple commits
+      this.updateType = UpdateType.SIMPLE;
 
-    // all future commits should be simple commits
-    this.updateType = UpdateType.SIMPLE;
-
-    updateCurrentMetadata(response);
+      updateCurrentMetadata(response);
+    } catch (RESTException e) {
+      if (e.getCause() != null && e.getCause() instanceof IOException) {
+        // any IOException or unhandled Exception should be considered as 
commit unknown
+        // so that caller can attempt to potentially reconcile
+        throw new CommitStateUnknownException(e);
+      }
+      throw e;
+    }

Review Comment:
   you are right, read more about this, 
https://github.com/apache/iceberg/commit/768e516e0b138a6e996fe38fe5be4a0f624862db
 seems like we mark strictCleanUp as true in RESTTableOps, so this never 
trigger a cleanup for unhandled RESTException. 
   Let me see more, if this is leaking from some of ErrorHandler ? As one thing 
we know there is no status code atleast for this one. 



-- 
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]

Reply via email to