[ https://issues.apache.org/jira/browse/HDDS-1407?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
chencan reassigned HDDS-1407: ----------------------------- Assignee: chencan > Change Log Level to trace in NetUtils.java > ------------------------------------------ > > Key: HDDS-1407 > URL: https://issues.apache.org/jira/browse/HDDS-1407 > Project: Hadoop Distributed Data Store > Issue Type: Bug > Reporter: Bharat Viswanadham > Assignee: chencan > Priority: Major > Labels: newbie > > When there is no String Constructor for the exception, we Log a Warn Message, > and rethrow the exception. We can change the Log level to TRACE/DEBUG. > > {code:java} > private static <T extends IOException> T wrapWithMessage( > T exception, String msg) throws T { > Class<? extends Throwable> clazz = exception.getClass(); > try { > Constructor<? extends Throwable> ctor = clazz.getConstructor(String.class); > Throwable t = ctor.newInstance(msg); > return (T)(t.initCause(exception)); > } catch (Throwable e) { > LOG.warn("Unable to wrap exception of type {}: it has no (String) " > + "constructor", clazz, e); > throw exception; > } > }{code} > {code:java} > 2019-04-09 18:07:27,824 WARN ipc.Client > (Client.java:handleConnectionFailure(938)) - Interrupted while trying for > connection > 2019-04-09 18:07:27,826 WARN net.NetUtils > (NetUtils.java:wrapWithMessage(834)) - Unable to wrap exception of type class > java.nio.channels.ClosedByInterruptException: it has no (String) constructor > java.lang.NoSuchMethodException: > java.nio.channels.ClosedByInterruptException.<init>(java.lang.String) > at java.lang.Class.getConstructor0(Class.java:3082) > at java.lang.Class.getConstructor(Class.java:1825) > at org.apache.hadoop.net.NetUtils.wrapWithMessage(NetUtils.java:830) > at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:806) > at org.apache.hadoop.ipc.Client.getRpcResponse(Client.java:1515) > at org.apache.hadoop.ipc.Client.call(Client.java:1457) > at org.apache.hadoop.ipc.Client.call(Client.java:1367) > at > org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:228) > at > org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:116) > at com.sun.proxy.$Proxy84.register(Unknown Source) > at > org.apache.hadoop.ozone.protocolPB.StorageContainerDatanodeProtocolClientSideTranslatorPB.register(StorageContainerDatanodeProtocolClientSideTranslatorPB.java:160) > at > org.apache.hadoop.ozone.container.common.states.endpoint.RegisterEndpointTask.call(RegisterEndpointTask.java:120) > at > org.apache.hadoop.ozone.container.common.states.endpoint.RegisterEndpointTask.call(RegisterEndpointTask.java:47) > at java.util.concurrent.FutureTask.run(FutureTask.java:266) > at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) > at java.util.concurrent.FutureTask.run(FutureTask.java:266) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > at java.lang.Thread.run(Thread.java:748){code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org