HADOOP-10612. NFS failed to refresh the user group id mapping table. Contributed by Brandon Li

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1596075 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brandon Li 2014-05-19 22:16:11 +00:00
parent 4a839f0cc1
commit 674c523db1
2 changed files with 5 additions and 2 deletions

View File

@ -521,6 +521,8 @@ Release 2.4.1 - UNRELEASED
HADOOP-10527. Fix incorrect return code and allow more retries on EINTR. HADOOP-10527. Fix incorrect return code and allow more retries on EINTR.
(kihwal) (kihwal)
HADOOP-10612. NFS failed to refresh the user group id mapping table (brandonli)
Release 2.4.0 - 2014-04-07 Release 2.4.0 - 2014-04-07
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -24,6 +24,7 @@
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.util.Time;
import com.google.common.annotations.VisibleForTesting; import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.BiMap; import com.google.common.collect.BiMap;
@ -79,7 +80,7 @@ public long getTimeout() {
} }
synchronized private boolean isExpired() { synchronized private boolean isExpired() {
return lastUpdateTime - System.currentTimeMillis() > timeout; return Time.monotonicNow() - lastUpdateTime > timeout;
} }
// If can't update the maps, will keep using the old ones // If can't update the maps, will keep using the old ones
@ -210,7 +211,7 @@ synchronized public void updateMaps() throws IOException {
uidNameMap = uMap; uidNameMap = uMap;
gidNameMap = gMap; gidNameMap = gMap;
lastUpdateTime = System.currentTimeMillis(); lastUpdateTime = Time.monotonicNow();
} }
synchronized public int getUid(String user) throws IOException { synchronized public int getUid(String user) throws IOException {