You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by su...@apache.org on 2019/09/17 14:11:49 UTC
[hadoop] branch trunk updated: YARN-9833. Race condition when
DirectoryCollection.checkDirs() runs during container launch. Contributed
by Peter Bacsko.
This is an automated email from the ASF dual-hosted git repository.
sunilg pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new c474e24 YARN-9833. Race condition when DirectoryCollection.checkDirs() runs during container launch. Contributed by Peter Bacsko.
c474e24 is described below
commit c474e24c0b73c0f52a7d5af2495355f4a0799344
Author: Sunil G <su...@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.
---
.../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-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org