This is an automated email from the ASF dual-hosted git repository. sunilg pushed a commit to branch branch-3.2 in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.2 by this push: new 3e0025d YARN-9833. Race condition when DirectoryCollection.checkDirs() runs during container launch. Contributed by Peter Bacsko. 3e0025d is described below commit 3e0025d8776e0a1797b9261f4b1776c7c5a304a8 Author: Sunil G <sun...@apache.org> AuthorDate: Tue Sep 17 19:41:38 2019 +0530 YARN-9833. Race condition when DirectoryCollection.checkDirs() runs during container launch. Contributed by Peter Bacsko. (cherry picked from commit c474e24c0b73c0f52a7d5af2495355f4a0799344) --- .../apache/hadoop/yarn/server/nodemanager/DirectoryCollection.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/DirectoryCollection.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/DirectoryCollection.java index d0a0219..3462aa4 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/DirectoryCollection.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/DirectoryCollection.java @@ -48,6 +48,7 @@ import org.apache.hadoop.yarn.conf.YarnConfiguration; import org.apache.hadoop.yarn.exceptions.YarnRuntimeException; import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.ImmutableList; /** * Manages a list of local storage directories. @@ -227,7 +228,7 @@ public class DirectoryCollection { List<String> getGoodDirs() { this.readLock.lock(); try { - return Collections.unmodifiableList(localDirs); + return ImmutableList.copyOf(localDirs); } finally { this.readLock.unlock(); } @@ -239,7 +240,7 @@ public class DirectoryCollection { List<String> getFailedDirs() { this.readLock.lock(); try { - return Collections.unmodifiableList( + return ImmutableList.copyOf( DirectoryCollection.concat(errorDirs, fullDirs)); } finally { this.readLock.unlock(); @@ -252,7 +253,7 @@ public class DirectoryCollection { List<String> getFullDirs() { this.readLock.lock(); try { - return Collections.unmodifiableList(fullDirs); + return ImmutableList.copyOf(fullDirs); } finally { this.readLock.unlock(); } --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org