okumin opened a new pull request, #14908:
URL: https://github.com/apache/iceberg/pull/14908

   I see a long stack trace every time a REST server returns an error response, 
e.g., 404. This is the minimal reproduction.
   
   ```bash
   $ gradle :iceberg-core:test --tests 
"org.apache.iceberg.rest.TestRESTCatalog.testSetNamespacePropertiesNamespaceDoesNotExist"
   ...
   [qtp236002428-39] ERROR org.apache.iceberg.rest.RESTCatalogServlet - Error 
processing REST request
   org.apache.iceberg.exceptions.RESTException: Unhandled error: 
ErrorResponse(code=404, type=NoSuchNamespaceException, message=Namespace does 
not exist: newdb)
   org.apache.iceberg.exceptions.NoSuchNamespaceException: Namespace does not 
exist: newdb
        at 
org.apache.iceberg.inmemory.InMemoryCatalog.loadNamespaceMetadata(InMemoryCatalog.java:275)
        at 
org.apache.iceberg.rest.CatalogHandlers.updateNamespaceProperties(CatalogHandlers.java:218)
        at 
org.apache.iceberg.rest.RESTCatalogAdapter.handleRequest(RESTCatalogAdapter.java:242)
        at 
java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
        at 
org.apache.iceberg.rest.RESTCatalogAdapter.handleRequest(RESTCatalogAdapter.java:165)
        at 
org.apache.iceberg.rest.RESTCatalogAdapter.execute(RESTCatalogAdapter.java:569)
        at 
java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
   ```
   
   1. When an error happens, [errorHandler is 
triggered](https://github.com/apache/iceberg/blob/d6d44a7803b218e7da6d514e96ad98282f22a2b6/core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java#L584)
   2. [The error handler constructs the error response, without throwing an 
exception](https://github.com/apache/iceberg/blob/d6d44a7803b218e7da6d514e96ad98282f22a2b6/core/src/test/java/org/apache/iceberg/rest/RESTCatalogServlet.java#L152-L161)
   3. [The adapter throws a 
RESTException](https://github.com/apache/iceberg/blob/d6d44a7803b218e7da6d514e96ad98282f22a2b6/core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java#L587)
   4. [The servlet implementation attempts a non-local exit and logs the 
exception](https://github.com/apache/iceberg/blob/d6d44a7803b218e7da6d514e96ad98282f22a2b6/core/src/test/java/org/apache/iceberg/rest/RESTCatalogServlet.java#L109-L131)
   
   Logging a stack trace for a 404 Not Found response is verbose in most use 
cases.
   
   The first implementation of this pull request does not change the overall 
flow control. Ideally, `RESTCatalogAdapter#execute` should probably not throw a 
RESTException; however, it may require modifying `BaseHTTPClient`, so I opened 
this PR with a minimal change.


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