YARN-2964. FSLeafQueue#assignContainer - document the reason for using both write and read locks. (Tsuyoshi Ozawa via kasha)

This commit is contained in:
Karthik Kambatla 2014-12-17 12:03:16 -08:00
parent 9b4ba409c6
commit f2d150ea12
2 changed files with 6 additions and 0 deletions

View File

@ -231,6 +231,9 @@ Release 2.7.0 - UNRELEASED
YARN-2914. [YARN-1492] Potential race condition in Singleton implementation of YARN-2914. [YARN-1492] Potential race condition in Singleton implementation of
SharedCacheUploaderMetrics, CleanerMetrics, ClientSCMMetrics. (Varun Saxena via kasha) SharedCacheUploaderMetrics, CleanerMetrics, ClientSCMMetrics. (Varun Saxena via kasha)
YARN-2964. FSLeafQueue#assignContainer - document the reason for using both write and
read locks. (Tsuyoshi Ozawa via kasha)
Release 2.6.0 - 2014-11-18 Release 2.6.0 - 2014-11-18
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -252,6 +252,9 @@ public class FSLeafQueue extends FSQueue {
} finally { } finally {
writeLock.unlock(); writeLock.unlock();
} }
// Release write lock here for better performance and avoiding deadlocks.
// runnableApps can be in unsorted state because of this section,
// but we can accept it in practice since the probability is low.
readLock.lock(); readLock.lock();
try { try {
for (FSAppAttempt sched : runnableApps) { for (FSAppAttempt sched : runnableApps) {