You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2020/07/30 22:33:36 UTC

[GitHub] [hadoop] liuml07 commented on a change in pull request #2178: HADOOP-17164 UGI loginUserFromKeytab doesn't set the last login time

liuml07 commented on a change in pull request #2178:
URL: https://github.com/apache/hadoop/pull/2178#discussion_r463304087



##########
File path: hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java
##########
@@ -528,6 +528,10 @@ private HadoopLoginContext getLogin() {
   private void setLogin(LoginContext login) {
     user.setLogin(login);
   }
+  
+  private void setLastLogin(long now) {

Review comment:
       Make `@param time` and `long now` the same variable name? e.g. name it `loginTime`

##########
File path: hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java
##########
@@ -1968,6 +1976,7 @@ private static UserGroupInformation doSubjectLogin(
       if (subject == null) {
         params.put(LoginParam.PRINCIPAL, ugi.getUserName());
         ugi.setLogin(login);
+        ugi.setLastLogin(Time.now());

Review comment:
       the `user::lastLogin` was the last attempt to login. I'm not sure if we should put this before the `try` clause (aka before L1969)?
   
   CC: @steveloughran 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org