You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/02/03 13:31:54 UTC

[GitHub] [ozone] adoroszlai opened a new pull request #3039: HDDS-6247. Avoid logging stack trace for user input problems

adoroszlai opened a new pull request #3039:
URL: https://github.com/apache/ozone/pull/3039


   ## What changes were proposed in this pull request?
   
   Follow-up for HDDS-6206: avoid logging exception as error when they are known cases (e.g. invalid bucket name, checking existence (`head`) of non-existing bucket, permission denied, etc.).
   
   https://issues.apache.org/jira/browse/HDDS-6247
   
   ## How was this patch tested?
   
   Ran S3 acceptance tests before and after the change.  Verified S3 Gateway logs no longer have verbose stack trace for these requests.  We can still see request problems by setting log level to DEBUG, e.g.:
   
   ```
   s3g_1       | 2022-02-03 12:54:57,459 [qtp690052870-16] DEBUG exception.S3ErrorTable: <?xml version="1.0" encoding="UTF-8"?>
   s3g_1       | <Error>
   s3g_1       |   <Code>InvalidBucketName</Code>
   s3g_1       |   <Message>The specified bucket is not valid.</Message>
   s3g_1       |   <Resource>a_b_c</Resource>
   s3g_1       |   <RequestId/>
   s3g_1       | </Error>
   ...
   s3g_1       | 2022-02-03 12:59:56,517 [qtp690052870-20] DEBUG exception.S3ErrorTable: <?xml version="1.0" encoding="UTF-8"?>
   s3g_1       | <Error>
   s3g_1       |   <Code>NoSuchBucket</Code>
   s3g_1       |   <Message>The specified bucket does not exist</Message>
   s3g_1       |   <Resource>dont-exist</Resource>
   s3g_1       |   <RequestId/>
   s3g_1       | </Error>
   ```
   
   https://github.com/adoroszlai/hadoop-ozone/actions/runs/1787777620


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] ayushtkn commented on a change in pull request #3039: HDDS-6247. Avoid logging stack trace for user input problems

Posted by GitBox <gi...@apache.org>.
ayushtkn commented on a change in pull request #3039:
URL: https://github.com/apache/ozone/pull/3039#discussion_r800435033



##########
File path: hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java
##########
@@ -208,23 +208,20 @@ public Response put(
 
       return Response.ok().status(HttpStatus.SC_OK)
           .build();
-    } catch (IOException ex) {

Review comment:
       Why do you want to change IOE to OME? Not logging for known OME makes sense, but now any IOE will get propagated directly without logging. If I catch the intention was to not log the know client issues, like permissions and stuff. But IOE can surface from any reason




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on a change in pull request #3039: HDDS-6247. Avoid logging stack trace for user input problems

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #3039:
URL: https://github.com/apache/ozone/pull/3039#discussion_r800510201



##########
File path: hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java
##########
@@ -208,23 +208,20 @@ public Response put(
 
       return Response.ok().status(HttpStatus.SC_OK)
           .build();
-    } catch (IOException ex) {

Review comment:
       Thanks @ayushtkn for the question.
   
   All other methods in `ObjectEndpoint` only catch `OMException` and directly propagate `IOException`.
   
   ```
   $ grep -F 'catch (' hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java
       } catch (OMException ex) {
       } catch (OMException ex) {
       } catch (OMException ex) {
       } catch (OMException ex) {
       } catch (OMException ex) {
       } catch (OMException ex) {
       } catch (OMException ex) {
       } catch (OMException ex) {
       } catch (OMException ex) {
       } catch (OMException ex) {
       } catch (UnsupportedEncodingException e) {
       } catch (IllegalArgumentException ex) {
       } catch (ParseException e) {
   ```
   
   Uncaught `IOException` is handled at a different layer, and logged with stack trace:
   
   ```
   s3g_1       | 2022-02-07 10:11:02,633 [qtp1498438472-16] WARN server.HttpChannel: handleException /bucket-ozone-test-2711154630/ozone-test-4349237846/putobject/key%3Dvalue/f1 java.io.IOException: TESTING
   ...
   s3g_1       | Caused by: java.io.IOException: TESTING
   s3g_1       | 	at org.apache.hadoop.ozone.s3.endpoint.ObjectEndpoint.put(ObjectEndpoint.java:200)
   ...
   ```




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] ayushtkn commented on a change in pull request #3039: HDDS-6247. Avoid logging stack trace for user input problems

Posted by GitBox <gi...@apache.org>.
ayushtkn commented on a change in pull request #3039:
URL: https://github.com/apache/ozone/pull/3039#discussion_r802310590



##########
File path: hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java
##########
@@ -208,23 +208,20 @@ public Response put(
 
       return Response.ok().status(HttpStatus.SC_OK)
           .build();
-    } catch (IOException ex) {

Review comment:
       Makes sense. Should be Ok then




-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] kuenishi commented on pull request #3039: HDDS-6247. Avoid logging stack trace for user input problems

Posted by GitBox <gi...@apache.org>.
kuenishi commented on pull request #3039:
URL: https://github.com/apache/ozone/pull/3039#issuecomment-1031073271


   @adoroszlai Looks good to me. Thank you for the follow up, as I was only aware of HDDS-6206, but wasn't aware of cases fixed here.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on pull request #3039: HDDS-6247. Avoid logging stack trace for user input problems

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on pull request #3039:
URL: https://github.com/apache/ozone/pull/3039#issuecomment-1030595423


   @kuenishi this is continuation of your work from HDDS-6206, please review if you have some time.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai merged pull request #3039: HDDS-6247. Avoid logging stack trace for user input problems

Posted by GitBox <gi...@apache.org>.
adoroszlai merged pull request #3039:
URL: https://github.com/apache/ozone/pull/3039


   


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] adoroszlai commented on pull request #3039: HDDS-6247. Avoid logging stack trace for user input problems

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on pull request #3039:
URL: https://github.com/apache/ozone/pull/3039#issuecomment-1033464262


   Thanks @ayushtkn and @kuenishi for the review.


-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org