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:
parent
3361e76e30
commit
01a407d9df
@ -746,6 +746,9 @@ Trunk (unreleased changes)
|
||||
HDFS-1942. Datanode must exist when all the block pool service threads
|
||||
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
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
@ -190,9 +190,6 @@ public void initialize(final URI name, final Configuration conf)
|
||||
}
|
||||
}
|
||||
|
||||
//Renew TGT if needed
|
||||
ugi.reloginFromKeytab();
|
||||
|
||||
//since we don't already have a token, go get one over https
|
||||
if (delegationToken == null) {
|
||||
delegationToken =
|
||||
@ -204,8 +201,10 @@ public void initialize(final URI name, final Configuration conf)
|
||||
|
||||
|
||||
@Override
|
||||
public Token<?> getDelegationToken(final String renewer) throws IOException {
|
||||
public synchronized Token<?> getDelegationToken(final String renewer) throws IOException {
|
||||
try {
|
||||
//Renew TGT if needed
|
||||
ugi.reloginFromKeytab();
|
||||
return ugi.doAs(new PrivilegedExceptionAction<Token<?>>() {
|
||||
public Token<?> run() throws IOException {
|
||||
Credentials c;
|
||||
|
Loading…
Reference in New Issue
Block a user