steveloughran commented on code in PR #4241:
URL: https://github.com/apache/hadoop/pull/4241#discussion_r884803308
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java:
##########
@@ -449,15 +449,19 @@ protected DelegationTokenInformation
checkToken(TokenIdent identifier)
throws InvalidToken {
assert Thread.holdsLock(this);
DelegationTokenInformation info = getTokenInfo(identifier);
+ String err;
if (info == null) {
- throw new InvalidToken("token " + formatTokenId(identifier)
- + " can't be found in cache");
+ err = "Token for real user: " + identifier.getRealUser() + ", can't be
found in cache";
+ LOG.warn(err + ", Token=" + formatTokenId(identifier));
+ throw new InvalidToken(err);
}
long now = Time.now();
if (info.getRenewDate() < now) {
- throw new InvalidToken("token " + formatTokenId(identifier) + " is " +
- "expired, current time: " + Time.formatTime(now) +
- " expected renewal time: " + Time.formatTime(info.getRenewDate()));
+ err =
+ "Token has" + identifier.getRealUser() + "expired, current time: " +
Time.formatTime(now)
+ + " expected renewal time: " +
Time.formatTime(info.getRenewDate());
+ LOG.info(err + ", Token=" + formatTokenId(identifier));
Review Comment:
can you use
```
LOG.info("{}, Token={}", err, formatTokenId(identifier));
```
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java:
##########
@@ -449,15 +449,19 @@ protected DelegationTokenInformation
checkToken(TokenIdent identifier)
throws InvalidToken {
assert Thread.holdsLock(this);
DelegationTokenInformation info = getTokenInfo(identifier);
+ String err;
if (info == null) {
- throw new InvalidToken("token " + formatTokenId(identifier)
- + " can't be found in cache");
+ err = "Token for real user: " + identifier.getRealUser() + ", can't be
found in cache";
+ LOG.warn(err + ", Token=" + formatTokenId(identifier));
Review Comment:
can you use
```
LOG.warn("{}, Token={}", err, formatTokenId(identifier));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]