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

hadoop shell producing unexpected output to stdout

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 0.21.0
    • None
    • security, util
    • None
    • Incompatible change

    Description

      Using "hadoop fs -dus foobar/*" I found unexpected output to stdout as the first line prints some debugging information about kerberos tokens. This is breaking scripts which used to work with 0.20.x.

      Retrieving token from: https://1.2.3.4:50470/getDelegationToken
      hftp://blah.yahoo.net:50070/foo/bang 685256
      hftp://blah.yahoo.net:50070/foo/bar 685256
      hftp://blah.yahoo.net:50070/foo/baz 685256
      [...]

      Which appears to be coming from this line

      ./hadoop-0.21.0/hdfs/src/java/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java:151: System.out.println("Retrieving token from: " +

      I also see a few other cases here which should be changed to use a logging service, changed to System.err, or removed:

      grep -n -2 System.out ./hadoop-0.21.0/hdfs/src/java/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java

      90-
      91- out.flush();
      92: System.out.println("Succesfully wrote token of size " +
      93- out.size() + " bytes to "+ args[0]);
      94- } catch (IOException ioe)

      { 95: System.out.println("Exception encountered:\n" + 96- StringUtils.stringifyException(ioe)); 97- }

      finally {

      149-
      150- try

      { 151: System.out.println("Retrieving token from: " + 152- nnAddr + DelegationTokenServlet.PATH_SPEC + ugiPostfix); 153- URL remoteURL = new URL(nnAddr + DelegationTokenServlet.PATH_SPEC + ugiPostfix); -- 161- ts.write(file); 162- file.flush(); 163: System.out.println("Successfully wrote token of " + file.size() 164- + " bytes to " + filename); 165- }

      catch (Exception e) {

      Attachments

        Activity

          People

            templedf Daniel Templeton
            thayer Charles Thayer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: