YARN-7630. Fix AMRMToken rollover handling in AMRMProxy. Contributed by Botong Huang.
(cherry picked from commit 17ba74be29193ac15474f73baaaf4e647a95078b)
This commit is contained in:
parent
08a50da95f
commit
8d3d7fa1c5
@ -163,8 +163,12 @@ public static <T> T createRMProxy(final Configuration configuration,
|
|||||||
LOG.info("Creating RMProxy to RM {} for protocol {} for user {}",
|
LOG.info("Creating RMProxy to RM {} for protocol {} for user {}",
|
||||||
rmClusterId, protocol.getSimpleName(), user);
|
rmClusterId, protocol.getSimpleName(), user);
|
||||||
if (token != null) {
|
if (token != null) {
|
||||||
token.setService(ClientRMProxy.getAMRMTokenService(configuration));
|
// preserve the token service sent by the RM when adding the token
|
||||||
|
// to ensure we replace the previous token setup by the RM.
|
||||||
|
// Afterwards we can update the service address for the RPC layer.
|
||||||
|
// Same as YarnServerSecurityUtils.updateAMRMToken()
|
||||||
user.addToken(token);
|
user.addToken(token);
|
||||||
|
token.setService(ClientRMProxy.getAMRMTokenService(configuration));
|
||||||
setAuthModeInConf(configuration);
|
setAuthModeInConf(configuration);
|
||||||
}
|
}
|
||||||
final T proxyConnection = user.doAs(new PrivilegedExceptionAction<T>() {
|
final T proxyConnection = user.doAs(new PrivilegedExceptionAction<T>() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user