Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-7298

HDFS may honor socket timeout configuration

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • None
    • None
    • datanode
    • None

    Description

      DFS_CLIENT_SOCKET_TIMEOUT_KEY: HDFS socket read timeout
      DFS_DATANODE_SOCKET_WRITE_TIMEOUT_KEY: HDFS socket write timeout

      HDFS may honor socket timeout configuration:

      1. DataXceiver.java:

      1) existing code(not expected)
      int timeoutValue = dnConf.socketTimeout
      + (HdfsServerConstants.READ_TIMEOUT_EXTENSION * targets.length);
      int writeTimeout = dnConf.socketWriteTimeout +
      (HdfsServerConstants.WRITE_TIMEOUT_EXTENSION * targets.length);

      2) proposed code:

      int timeoutValue = dnConf.socketTimeout ? (dnConf.socketTimeout
      + (HdfsServerConstants.READ_TIMEOUT_EXTENSION * targets.length) : 0;

      int writeTimeout = dnConf.socketWriteTimeout ? (dnConf.socketWriteTimeout +
      (HdfsServerConstants.WRITE_TIMEOUT_EXTENSION * targets.length)) : 0;

      2) DFSClient.java

      existing code is expected:

      int getDatanodeWriteTimeout(int numNodes)

      { return (dfsClientConf.confTime > 0) ? (dfsClientConf.confTime + HdfsServerConstants.WRITE_TIMEOUT_EXTENSION * numNodes) : 0; }

      int getDatanodeReadTimeout(int numNodes)

      { return dfsClientConf.socketTimeout > 0 ? (HdfsServerConstants.READ_TIMEOUT_EXTENSION * numNodes + dfsClientConf.socketTimeout) : 0; }

      3) DataNode.java:

      existing code is not expected:

      long writeTimeout = dnConf.socketWriteTimeout +
      HdfsServerConstants.WRITE_TIMEOUT_EXTENSION * (targets.length-1);

      proposed code:

      long writeTimeout = dnConf.socketWriteTimeout ? (dnConf.socketWriteTimeout +
      HdfsServerConstants.WRITE_TIMEOUT_EXTENSION * (targets.length-1)) : 0;

      Attachments

        1. HDFS-7298.patch
          3 kB
          Sameer Abhyankar

        Activity

          People

            sabhyankar Sameer Abhyankar
            rguo Guo Ruijing
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: