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

DelegationTokenAuthenticationHandler writes via closed writer

    Details

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

      Description

      By default, jackson's ObjectMapper closes the writer after writing, so in the following code

      ObjectMapper jsonMapper = new ObjectMapper();
      jsonMapper.writeValue(writer, map);
      writer.write(ENTER);
      

      (https://github.com/apache/hadoop/blob/8a9d293dd60f6d51e1574e412d40746ba8175fe1/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticationHandler.java#L280-L282)

      writer.write actually writes to a closed stream. This doesn't seem to cause a problem with the version of jetty that hadoop uses (those just ignore closes), but causes problems on later verisons of jetty – I hit this on jetty 8 while implementing SOLR-9200.

        Attachments

        1. HADOOP-13346.patch
          6 kB
          Gregory Chanan
        2. HADOOP-13346-001.patch
          6 kB
          Hrishikesh Gadre

          Activity

            People

            • Assignee:
              hgadre Hrishikesh Gadre
              Reporter:
              gchanan Gregory Chanan
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: