Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
UGI Credentials#addToken silently overrides the token with same service name.
public void addToken(Text alias, Token<? extends TokenIdentifier> t) { if (t == null) { LOG.warn("Null token ignored for " + alias); } else if (tokenMap.put(alias, t) != null) { // Update private tokens Map<Text, Token<? extends TokenIdentifier>> tokensToAdd = new HashMap<>(); for (Map.Entry<Text, Token<? extends TokenIdentifier>> e : tokenMap.entrySet()) { Token<? extends TokenIdentifier> token = e.getValue(); if (token.isPrivateCloneOf(alias)) { tokensToAdd.put(e.getKey(), t.privateClone(token.getService())); } } tokenMap.putAll(tokensToAdd); } }
There are tokens which does not have service name like YARN_AM_RM_TOKEN, Localizer and these tokens gets overridden and causes access issues later which are tough to debug.
1. Need to check if they can be added with some random unique name.
2. Or at least a error message should be logged.