Browse Source

HADOOP-14354. SysInfoWindows is not thread safe. Contributed by Inigo Goiri

(cherry picked from commit 689fb2fc661f233367ecbfa26795ff4c01408f3e)
Chris Douglas 8 years ago
parent
commit
d50f5b7df4

+ 1 - 1
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/SysInfoWindows.java

@@ -91,7 +91,7 @@ public class SysInfoWindows extends SysInfo {
     return null;
   }
 
-  void refreshIfNeeded() {
+  synchronized void refreshIfNeeded() {
     long now = now();
     if (now - lastRefreshTime > REFRESH_INTERVAL_MS) {
       long refreshInterval = now - lastRefreshTime;