Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-16243

Change Log Level to trace in NetUtils.java

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.3.0
    • None

    Description

      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.

       

      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;
      }
      }
      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)

      Attachments

        1. HDDS-1407.001.patch
          0.8 kB
          chencan

        Issue Links

          Activity

            People

              candychencan chencan
              bharat Bharat Viswanadham
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: