Repository navigation
REST: Map commit_table 404 and 503 responses like Java - #4465
Merged
Merged
Conversation
commit_table documents NoSuchTableError for a missing table, but a 404 was not mapped and surfaced as a generic RESTError. A 503 raised ServiceUnavailableError, while Java's CommitErrorHandler treats 500, 502, 503 and 504 as CommitStateUnknownException, since the server may have applied the commit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
RestCatalog.commit_tabledocumentsNoSuchTableErrorfor a missing table, but a 404 was not in its error map, so it surfaced as a genericRESTError.A 503 raised
ServiceUnavailableError. Java'sErrorHandlers.CommitErrorHandlertreats 500, 502, 503 and 504 asCommitStateUnknownException, since the server may have applied the commit. 503 was added there in apache/iceberg#13619.This change maps 404 to
NoSuchTableErrorand 503 toCommitStateUnknownException, matching Java.Are these changes tested?
Yes.
test_commit_table_error_mappingintests/catalog/test_rest.pychecks the exception raised for 404, 409, 500, 502, 503 and 504.Are there any user-facing changes?
Yes:
NoSuchTableErrorinstead ofRESTError.CommitStateUnknownExceptioninstead ofServiceUnavailableError.AI disclosure: an AI coding assistant helped draft the change and the tests. The mapping was checked against Java's
ErrorHandlers, and the catalog tests and linters were run before submitting.