You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by dw...@apache.org on 2022/12/08 19:27:57 UTC
[iceberg] branch master updated: Core: Throw CommitStateUnknownException for 502 responses. (#6391)
This is an automated email from the ASF dual-hosted git repository.
dweeks pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iceberg.git
The following commit(s) were added to refs/heads/master by this push:
new ed31f86aaf Core: Throw CommitStateUnknownException for 502 responses. (#6391)
ed31f86aaf is described below
commit ed31f86aaf47835aaf69e447802c39e51a6dc641
Author: Ryan Blue <bl...@apache.org>
AuthorDate: Thu Dec 8 11:27:48 2022 -0800
Core: Throw CommitStateUnknownException for 502 responses. (#6391)
---
.../main/java/org/apache/iceberg/rest/ErrorHandlers.java | 1 +
open-api/rest-catalog-open-api.yaml | 14 ++++++++++++++
2 files changed, 15 insertions(+)
diff --git a/core/src/main/java/org/apache/iceberg/rest/ErrorHandlers.java b/core/src/main/java/org/apache/iceberg/rest/ErrorHandlers.java
index e7ed06e36e..5a7f9b59f2 100644
--- a/core/src/main/java/org/apache/iceberg/rest/ErrorHandlers.java
+++ b/core/src/main/java/org/apache/iceberg/rest/ErrorHandlers.java
@@ -79,6 +79,7 @@ public class ErrorHandlers {
case 409:
throw new CommitFailedException("Commit failed: %s", error.message());
case 500:
+ case 502:
case 504:
throw new CommitStateUnknownException(
new ServiceFailureException("Service failed: %s: %s", error.code(), error.message()));
diff --git a/open-api/rest-catalog-open-api.yaml b/open-api/rest-catalog-open-api.yaml
index be175ac2ba..1d810f4a07 100644
--- a/open-api/rest-catalog-open-api.yaml
+++ b/open-api/rest-catalog-open-api.yaml
@@ -614,6 +614,20 @@ paths:
}
503:
$ref: '#/components/responses/ServiceUnavailableResponse'
+ 502:
+ description:
+ A gateway or proxy received an invalid response from the upstream server; the commit state is unknown.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ErrorModel'
+ example: {
+ "error": {
+ "message": "Invalid response from the upstream server",
+ "type": "CommitStateUnknownException",
+ "code": 502
+ }
+ }
504:
description:
A server-side gateway timeout occurred; the commit state is unknown.