YARN-9833. Race condition when DirectoryCollection.checkDirs() runs during container launch. Contributed by Peter Bacsko.
This commit is contained in:
parent
7f9073132d
commit
c474e24c0b
@ -48,6 +48,7 @@
|
||||
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 @@ void deregisterDirsChangeListener(
|
||||
List<String> getGoodDirs() {
|
||||
this.readLock.lock();
|
||||
try {
|
||||
return Collections.unmodifiableList(localDirs);
|
||||
return ImmutableList.copyOf(localDirs);
|
||||
} finally {
|
||||
this.readLock.unlock();
|
||||
}
|
||||
@ -239,7 +240,7 @@ List<String> getGoodDirs() {
|
||||
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 @@ List<String> getFailedDirs() {
|
||||
List<String> getFullDirs() {
|
||||
this.readLock.lock();
|
||||
try {
|
||||
return Collections.unmodifiableList(fullDirs);
|
||||
return ImmutableList.copyOf(fullDirs);
|
||||
} finally {
|
||||
this.readLock.unlock();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user