[
https://issues.apache.org/jira/browse/HDFS-12583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16196507#comment-16196507
]
Weiwei Yang commented on HDFS-12583:
------------------------------------
Hi [~anu], [~linyiqun]
Sorry for the late response as I was on vacation.
I think current code base parses a {{OzoneException}} to a JSON string and
encapsulate that to HTTP response, what I suggested was to add stacktrace as a
json string field. I don't think this will make the cross-language support
harder since client is always dealing with standard JSON strings.
Then I read some more docs about how JAX-RS handles exception, it looks like
the stacktrace is a bit difficult to parse. Also in Hadoop project, we only
ship exception message. There is an utility class
{{HttpExceptionUtils#createJerseyExceptionResponse}}. So I agree lets stick to
current approach, and add error log in server side to make debug easier (like
the patch [~linyiqun] provided).
Get back to the problem this JIRA wanted to resolve, the biggest problem is
even the message was not accurate
{noformat}
org.apache.hadoop.ozone.web.exceptions.OzoneException: Exception getting
XceiverClient.
{noformat}
this was caused by following code
{code}
private XceiverClientSpi getClient(Pipeline pipeline)
throws IOException {
...
} catch (Exception e) {
// this resets the message which is not really meaningful
throw new IOException("Exception getting XceiverClient.", e);
}
{code}
if we change that line to {{throw new IOException(e);}}, would that remains to
use original message? The goal is to let client at least get the accurate error
message to understand what happened.
Please let me know if this makes sense.
> 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: [email protected]
For additional commands, e-mail: [email protected]