HDFS-1656. Fixes an issue to do with fetching of delegation tokens in HftpFileSystem. Contributed by Kan Zhang.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1136608 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Matthew Foley 2011-06-16 19:04:26 +00:00
parent 3361e76e30
commit 01a407d9df
2 changed files with 6 additions and 4 deletions

View File

@ -746,6 +746,9 @@ Trunk (unreleased changes)
HDFS-1942. Datanode must exist when all the block pool service threads HDFS-1942. Datanode must exist when all the block pool service threads
exit. (Bharath Mundlapudi via suresh) exit. (Bharath Mundlapudi via suresh)
HDFS-1656. Fixes an issue to do with fetching of delegation tokens in
HftpFileSystem. Contributed by Kan Zhang.
Release 0.22.0 - Unreleased Release 0.22.0 - Unreleased
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -190,9 +190,6 @@ public class HftpFileSystem extends FileSystem {
} }
} }
//Renew TGT if needed
ugi.reloginFromKeytab();
//since we don't already have a token, go get one over https //since we don't already have a token, go get one over https
if (delegationToken == null) { if (delegationToken == null) {
delegationToken = delegationToken =
@ -204,8 +201,10 @@ public class HftpFileSystem extends FileSystem {
@Override @Override
public Token<?> getDelegationToken(final String renewer) throws IOException { public synchronized Token<?> getDelegationToken(final String renewer) throws IOException {
try { try {
//Renew TGT if needed
ugi.reloginFromKeytab();
return ugi.doAs(new PrivilegedExceptionAction<Token<?>>() { return ugi.doAs(new PrivilegedExceptionAction<Token<?>>() {
public Token<?> run() throws IOException { public Token<?> run() throws IOException {
Credentials c; Credentials c;