HDFS-10617. PendingReconstructionBlocks.size() should be synchronized. Contributed by Eric Badger.

This commit is contained in:
Kihwal Lee 2016-07-13 21:59:35 -05:00
parent 728bf7f698
commit 2bbc3ea1b5
1 changed files with 3 additions and 1 deletions

View File

@ -134,8 +134,10 @@ class PendingReconstructionBlocks {
* The total number of blocks that are undergoing reconstruction. * The total number of blocks that are undergoing reconstruction.
*/ */
int size() { int size() {
synchronized (pendingReconstructions) {
return pendingReconstructions.size(); return pendingReconstructions.size();
} }
}
/** /**
* How many copies of this block is pending reconstruction?. * How many copies of this block is pending reconstruction?.