Skip to content

Commit b615792

Browse files
committed
HADOOP-6905. Better logging messages when a delegation token is invalid. Contributed by Kan Zhang.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@986172 13f79535-47bb-0310-9956-ffa450edef68
1 parent 732789a commit b615792

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ Trunk (unreleased changes)
117117
throw IOException rather than RuntimeException when there is an IO error
118118
fetching the next file. (hairong)
119119

120+
HADOOP-6905. Better logging messages when a delegation token is invalid.
121+
(Kan Zhang via jghoman)
122+
120123
OPTIMIZATIONS
121124

122125
BUG FIXES

src/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,12 @@ public synchronized byte[] retrievePassword(TokenIdent identifier)
198198
throws InvalidToken {
199199
DelegationTokenInformation info = currentTokens.get(identifier);
200200
if (info == null) {
201-
throw new InvalidToken("token is expired or doesn't exist");
201+
throw new InvalidToken("token (" + identifier.toString()
202+
+ ") can't be found in cache");
202203
}
203204
long now = System.currentTimeMillis();
204205
if (info.getRenewDate() < now) {
205-
throw new InvalidToken("token is expired");
206+
throw new InvalidToken("token (" + identifier.toString() + ") is expired");
206207
}
207208
return info.getPassword();
208209
}

0 commit comments

Comments
 (0)