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

Reuse closeResponder to reset the response variable in DataStreamer#run

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-alpha2
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      When worked for HDFS-6532, I found that the error recovery will happens when responder close fails. The related codes:

      {code:title=DataStreamer.java|borderStyle=solid}
        public void run() {
          long lastPacket = Time.monotonicNow();
          TraceScope scope = null;
          while (!streamerClosed && dfsClient.clientRunning) {
            // if the Responder encountered an error, shutdown Responder
            if (errorState.hasError() && response != null) {
              try {
                response.close();
                response.join();
                response = null;
              } catch (InterruptedException e) {
                // If interruptedException happens, the response will not be set to null
                // and that will lead the error recovry.
                LOG.warn("Caught exception", e);
              }
            }
            // Here need add a finally block to set response as null
            ...
      

      Can see the related comment:https://issues.apache.org/jira/browse/HDFS-6532?focusedCommentId=15448770&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15448770

        Attachments

        1. HDFS-10820.001.patch
          0.9 kB
          Yiqun Lin
        2. HDFS-10820.002.patch
          1.0 kB
          Yiqun Lin

          Activity

            People

            • Assignee:
              linyiqun Yiqun Lin
              Reporter:
              linyiqun Yiqun Lin
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: