[jira] [Updated] (YARN-3263) ContainerManagerImpl#parseCredentials don't rewind the ByteBuffer after credentials.readTokenStorageStream

2015-02-25 Thread zhihai xu (JIRA)

 [ 
https://issues.apache.org/jira/browse/YARN-3263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhihai xu updated YARN-3263:

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.
{code}
  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 tk : credentials.getAllTokens()) {
  LOG.debug(tk.getService() + " = " + tk.toString());
}
  }
}
//  End of parsing credentials
return credentials;
  }
{code}

  was:ContainerManagerImpl#parseCredentials don't rewind the ByteBuffer after 
credentials.readTokenStorageStream. So the next time if we access Tokens, we 
will have EOFException.


> ContainerManagerImpl#parseCredentials don't rewind the ByteBuffer after 
> credentials.readTokenStorageStream
> --
>
> Key: YARN-3263
> URL: https://issues.apache.org/jira/browse/YARN-3263
> Project: Hadoop YARN
>  Issue Type: Bug
>  Components: nodemanager
>Reporter: zhihai xu
>Assignee: zhihai xu
>
> 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.
> {code}
>   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 tk : 
> credentials.getAllTokens()) {
>   LOG.debug(tk.getService() + " = " + tk.toString());
> }
>   }
> }
> //  End of parsing credentials
> return credentials;
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (YARN-3263) ContainerManagerImpl#parseCredentials don't rewind the ByteBuffer after credentials.readTokenStorageStream

2015-02-25 Thread zhihai xu (JIRA)

 [ 
https://issues.apache.org/jira/browse/YARN-3263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

zhihai xu updated YARN-3263:

Component/s: nodemanager

> ContainerManagerImpl#parseCredentials don't rewind the ByteBuffer after 
> credentials.readTokenStorageStream
> --
>
> Key: YARN-3263
> URL: https://issues.apache.org/jira/browse/YARN-3263
> Project: Hadoop YARN
>  Issue Type: Bug
>  Components: nodemanager
>Reporter: zhihai xu
>Assignee: zhihai xu
>
> ContainerManagerImpl#parseCredentials don't rewind the ByteBuffer after 
> credentials.readTokenStorageStream. So the next time if we access Tokens, we 
> will have EOFException.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)