This is an automated email from the ASF dual-hosted git repository.

ebadger pushed a commit to branch branch-2.10
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-2.10 by this push:
     new b80ff6e  YARN-9833. Race condition when 
DirectoryCollection.checkDirs() runs during container launch. Contributed by 
Peter Bacsko.
b80ff6e is described below

commit b80ff6ea57bcad50717fd8c5ef4f732aa28cbb05
Author: Eric Badger <[email protected]>
AuthorDate: Fri Jan 15 19:18:58 2021 +0000

    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 e408340..ec7e6b1 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
@@ -50,6 +50,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.
@@ -277,7 +278,7 @@ public class DirectoryCollection {
   List<String> getGoodDirs() {
     this.readLock.lock();
     try {
-      return Collections.unmodifiableList(localDirs);
+      return ImmutableList.copyOf(localDirs);
     } finally {
       this.readLock.unlock();
     }
@@ -289,7 +290,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();
@@ -302,7 +303,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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to