[ 
https://issues.apache.org/jira/browse/HDFS-12583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16198121#comment-16198121
 ] 

Yiqun Lin edited comment on HDFS-12583 at 10/10/17 3:52 AM:
------------------------------------------------------------

Thanks for the comments, everyone.

[~cheersyang], as I see your latest suggestion, it looks fine and won't make a 
major refactor for current model. But can we make a minor change like this? 
This can make error message looks friendly.
{code}
throw new IOException("Exception getting XceiverClient, reason: " + 
e.getMessage(), e);
{code} 
Sample output:
{noformat}
private XceiverClientSpi getClient(Pipeline pipeline)
      throws IOException {
    String containerName = pipeline.getContainerName();
    try {
      return clientCache.get(containerName,
          new Callable<XceiverClientSpi>() {
          @Override
          public XceiverClientSpi call() throws Exception {
            throw new IOException("Throw exception.");
          }
        });
    } catch (Exception e) {
      throw new IOException("Exception getting XceiverClient, reason: " + 
e.getMessage(), e);
    }
  }

{"httpCode":500,"shortMessage":"internalServerError","resource":"hdfs","message":"Exception
 getting XceiverClient, reason: java.io.IOException: Throw 
exception.","requestID":"04b5be34-c99f-4181-ad55-de4eaa6ce78c","hostName":"VIP-20161102IRH"}
{noformat}
Will update the patch.


was (Author: linyiqun):
Thanks for the comments, everyone.

[~cheersyang], as I see your latest suggestion, it looks fine and won't make a 
major refactor for current model. But can we make a minor change like this? 
This can make error message looks friendly.
{code}
throw new IOException("Exception getting XceiverClient, reason: " + 
e.getMessage(), e);
{code} 
Sample output:
{noformat}
private XceiverClientSpi getClient(Pipeline pipeline)
      throws IOException {
    String containerName = pipeline.getContainerName();
    try {
      return clientCache.get(containerName,
          new Callable<XceiverClientSpi>() {
          @Override
          public XceiverClientSpi call() throws Exception {
            throw new IOException("Throw exception.");
          }
        });
    } catch (Exception e) {
      throw new IOException("Exception getting XceiverClient, reason: " + 
e.getMessage(), e);
    }
  }

    
{"httpCode":500,"shortMessage":"internalServerError","resource":"hdfs","message":"Exception
 getting XceiverClient, reason: java.io.IOException: Throw 
exception.","requestID":"04b5be34-c99f-4181-ad55-de4eaa6ce78c","hostName":"VIP-20161102IRH"}
{noformat}


> Ozone: Fix swallow exceptions which makes hard to debug failures
> ----------------------------------------------------------------
>
>                 Key: HDFS-12583
>                 URL: https://issues.apache.org/jira/browse/HDFS-12583
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: ozone
>    Affects Versions: HDFS-7240
>            Reporter: Yiqun Lin
>            Assignee: Yiqun Lin
>         Attachments: HDFS-12583-HDFS-7240.001.patch, 
> HDFS-12583-HDFS-7240.002.patch, HDFS-12583-HDFS-7240.003.patch
>
>
> There are some places that swallow exceptions that makes client hard to debug 
> the failure. For example, if we get xceiver client from xceiver client 
> manager error, client only gets the error info like this:
> {noformat}
> org.apache.hadoop.ozone.web.exceptions.OzoneException: Exception getting 
> XceiverClient.
>       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>       at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>       at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>       at 
> com.fasterxml.jackson.databind.introspect.AnnotatedConstructor.call(AnnotatedConstructor.java:119)
>       at 
> com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createUsingDefault(StdValueInstantiator.java:243)
> {noformat}
> The error exception stack is missing. We should print the error log as well.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to