Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-3263

ContainerManagerImpl#parseCredentials don't rewind the ByteBuffer after credentials.readTokenStorageStream

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • nodemanager
    • None

    Description

      ContainerManagerImpl#parseCredentials don't rewind the ByteBuffer after credentials.readTokenStorageStream. So the next time if we access Tokens, we will have EOFException.
      The following is the code for parseCredentials in ContainerManagerImpl.

        private Credentials parseCredentials(ContainerLaunchContext launchContext)
            throws IOException {
          Credentials credentials = new Credentials();
          // //////////// Parse credentials
          ByteBuffer tokens = launchContext.getTokens();
      
          if (tokens != null) {
            DataInputByteBuffer buf = new DataInputByteBuffer();
            tokens.rewind();
            buf.reset(tokens);
            credentials.readTokenStorageStream(buf);
            if (LOG.isDebugEnabled()) {
              for (Token<? extends TokenIdentifier> tk : credentials.getAllTokens()) {
                LOG.debug(tk.getService() + " = " + tk.toString());
              }
            }
          }
          // //////////// End of parsing credentials
          return credentials;
        }
      

      Attachments

        Activity

          People

            zxu Zhihai Xu
            zxu Zhihai Xu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: