|
@@ -504,7 +504,7 @@ public class UserGroupInformation {
|
|
|
* Get the Kerberos TGT
|
|
|
* @return the user's TGT or null if none was found
|
|
|
*/
|
|
|
- private KerberosTicket getTGT() {
|
|
|
+ private synchronized KerberosTicket getTGT() {
|
|
|
Set<KerberosTicket> tickets = subject
|
|
|
.getPrivateCredentials(KerberosTicket.class);
|
|
|
for (KerberosTicket ticket : tickets) {
|
|
@@ -636,11 +636,8 @@ public class UserGroupInformation {
|
|
|
return;
|
|
|
|
|
|
KerberosTicket tgt = getTGT();
|
|
|
- if (tgt == null) {
|
|
|
- return;
|
|
|
- }
|
|
|
//Return if TGT is valid and is not going to expire soon.
|
|
|
- if (System.currentTimeMillis() < getRefreshTime(tgt)) {
|
|
|
+ if (tgt != null && System.currentTimeMillis() < getRefreshTime(tgt)) {
|
|
|
return;
|
|
|
}
|
|
|
|