This is an automated email from the ASF dual-hosted git repository.
yuqi1129 pushed a commit to branch cherry-pick-8e41cedf-to-branch-1.3
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to
refs/heads/cherry-pick-8e41cedf-to-branch-1.3 by this push:
new e8efd37e05 [#12879] fix(server): resolve cherry-pick conflicts for
branch-1.3
e8efd37e05 is described below
commit e8efd37e053e2b8218c4cd3f53e10d8ad57a21ed
Author: yuqi <[email protected]>
AuthorDate: Fri Sep 4 17:37:29 2026 +0800
[#12879] fix(server): resolve cherry-pick conflicts for branch-1.3
Keep only what 8e41cedf introduced. The conflicting hunks also carried
main-only context that branch-1.3 never had: the ConnectionFailedException
and OptimisticLockException branches in BaseExceptionHandler, their imports,
and testOptimisticLockConflictReturnsConflict. Those come from other commits
and are dropped here rather than back-ported as a side effect of this one.
Add the ErrorConstants import to TestUtils, which main already had and
branch-1.3 did not, so the new assertions compile.
Claude-Session: https://claude.ai/code/session_01EPJduJLZAREBg1bKxybe1e
---
.../org/apache/gravitino/server/web/TestUtils.java | 5 +----
.../server/web/rest/ExceptionHandlers.java | 18 ------------------
.../server/web/rest/TestExceptionHandlers.java | 22 ----------------------
3 files changed, 1 insertion(+), 44 deletions(-)
diff --git
a/server-common/src/test/java/org/apache/gravitino/server/web/TestUtils.java
b/server-common/src/test/java/org/apache/gravitino/server/web/TestUtils.java
index 82fa913cd7..0e8d5023b3 100644
--- a/server-common/src/test/java/org/apache/gravitino/server/web/TestUtils.java
+++ b/server-common/src/test/java/org/apache/gravitino/server/web/TestUtils.java
@@ -30,12 +30,9 @@ import javax.ws.rs.core.Response;
import org.apache.gravitino.audit.FilesetAuditConstants;
import org.apache.gravitino.audit.FilesetDataOperation;
import org.apache.gravitino.audit.InternalClientType;
+import org.apache.gravitino.dto.responses.ErrorConstants;
import org.apache.gravitino.dto.responses.ErrorResponse;
-<<<<<<< HEAD
-=======
-import org.apache.gravitino.exceptions.OptimisticLockException;
import org.apache.gravitino.exceptions.UnmodifiableStatisticException;
->>>>>>> 8e41cedff ([#12879] fix(server): return accurate HTTP statuses for
unsupported operations (#12880))
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
diff --git
a/server/src/main/java/org/apache/gravitino/server/web/rest/ExceptionHandlers.java
b/server/src/main/java/org/apache/gravitino/server/web/rest/ExceptionHandlers.java
index 75a4fea835..a6e3e38a43 100644
---
a/server/src/main/java/org/apache/gravitino/server/web/rest/ExceptionHandlers.java
+++
b/server/src/main/java/org/apache/gravitino/server/web/rest/ExceptionHandlers.java
@@ -1121,23 +1121,6 @@ public class ExceptionHandlers {
String errorMsg =
getBaseErrorMsg(formattedObject, op.name(), formattedParent,
getErrorMsg(e));
-<<<<<<< HEAD
-=======
-
- // A backend a catalog federates to being unreachable is a
downstream-dependency failure, not
- // an internal Gravitino error: surface it as 502 Bad Gateway so callers
can tell a dependency
- // outage from a server bug.
- if (e instanceof ConnectionFailedException) {
- // WARN, not ERROR: a dependency outage is not a Gravitino bug, but
still trace it here.
- LOG.warn(errorMsg, e);
- return Utils.connectionFailed(errorMsg, e);
- }
-
- if (e instanceof OptimisticLockException) {
- LOG.warn(errorMsg, e);
- return Utils.optimisticLockConflict(errorMsg, e);
- }
-
// Classify domain-specific UnsupportedOperationException subclasses
before the generic
// capability fallback below.
if (e instanceof UnmodifiableStatisticException) {
@@ -1150,7 +1133,6 @@ public class ExceptionHandlers {
return Utils.unsupportedOperation(errorMsg, e);
}
->>>>>>> 8e41cedff ([#12879] fix(server): return accurate HTTP statuses for
unsupported operations (#12880))
LOG.error(errorMsg, e);
return Utils.internalError(errorMsg, e);
}
diff --git
a/server/src/test/java/org/apache/gravitino/server/web/rest/TestExceptionHandlers.java
b/server/src/test/java/org/apache/gravitino/server/web/rest/TestExceptionHandlers.java
index 472e83353f..60140578cf 100644
---
a/server/src/test/java/org/apache/gravitino/server/web/rest/TestExceptionHandlers.java
+++
b/server/src/test/java/org/apache/gravitino/server/web/rest/TestExceptionHandlers.java
@@ -18,15 +18,11 @@
*/
package org.apache.gravitino.server.web.rest;
-<<<<<<< HEAD
-=======
import java.util.List;
import javax.ws.rs.core.Response;
import org.apache.gravitino.dto.responses.ErrorConstants;
import org.apache.gravitino.dto.responses.ErrorResponse;
-import org.apache.gravitino.exceptions.OptimisticLockException;
import org.apache.gravitino.exceptions.UnmodifiableStatisticException;
->>>>>>> 8e41cedff ([#12879] fix(server): return accurate HTTP statuses for
unsupported operations (#12880))
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@@ -59,23 +55,6 @@ public class TestExceptionHandlers {
String msg6 = ExceptionHandlers.BaseExceptionHandler.getErrorMsg(e6);
Assertions.assertEquals("", msg6);
}
-<<<<<<< HEAD
-=======
-
- @Test
- public void testOptimisticLockConflictReturnsConflict() {
- Response response =
- ExceptionHandlers.handleTableException(
- OperationType.ALTER,
- "table",
- "schema",
- new OptimisticLockException("The table was modified
concurrently"));
-
- Assertions.assertEquals(Response.Status.CONFLICT.getStatusCode(),
response.getStatus());
- ErrorResponse errorResponse = (ErrorResponse) response.getEntity();
- Assertions.assertEquals(ErrorConstants.OPTIMISTIC_LOCK_CONFLICT_CODE,
errorResponse.getCode());
- Assertions.assertEquals(OptimisticLockException.class.getSimpleName(),
errorResponse.getType());
- }
@Test
void testUnsupportedOperationReturnsNotImplemented() {
@@ -125,5 +104,4 @@ public class TestExceptionHandlers {
UnmodifiableStatisticException.class.getSimpleName(),
errorResponse.getType());
});
}
->>>>>>> 8e41cedff ([#12879] fix(server): return accurate HTTP statuses for
unsupported operations (#12880))
}