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

Allow configurable timeouts when connecting to HDFS via java FileSystem API

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 0.23.0
    • None
    • ipc
    • Allows clients to specify connection timeouts with the conf parameter "ipc.client.connection.timeout" (See the core-default.xml of the release for more information).

    Description

      If the NameNode is not available (in, for example, a network partition event separating the client from the NameNode), and an attempt is made to connect, then the FileSystem api will eventually timeout and throw an error. However, that timeout is currently hardcoded to be 20 seconds to connect, with 45 retries, for a total of a 15 minute wait before failure. While in many circumstances this is fine, there are also many circumstances (such as booting a service) where both the connection timeout and the number of retries should be significantly less, so as not to harm availability of other services.

      Investigating Client.java, I see that there are two fields in Connection: maxRetries and rpcTimeout. I propose either re-using those fields for initiating the connection as well; alternatively, using the already existing dfs.socket.timeout parameter to set the connection timeout on initialization, and potentially adding a new field such as dfs.connection.retries with a default of 45 to replicate current behaviors.

      Attachments

        1. timeout.patch
          3 kB
          Scott Fines
        2. HADOOP-7397.patch
          5 kB
          Harsh J

        Issue Links

          Activity

            People

              Unassigned Unassigned
              scottfines Scott Fines
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: