HDFS-5666. Fix inconsistent synchronization in BPOfferService (jxiang via cmccabe)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1551301 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Colin McCabe 2013-12-16 18:35:40 +00:00
parent 89a374afcb
commit 8e32e6aff1
2 changed files with 4 additions and 2 deletions

View File

@ -969,6 +969,8 @@ Release 2.3.0 - UNRELEASED
HDFS-4201. NPE in BPServiceActor#sendHeartBeat. (jxiang via cmccabe)
HDFS-5666. Fix inconsistent synchronization in BPOfferService (jxiang via cmccabe)
Release 2.2.0 - 2013-10-13
INCOMPATIBLE CHANGES

View File

@ -148,7 +148,7 @@ class BPOfferService {
return false;
}
String getBlockPoolId() {
synchronized String getBlockPoolId() {
if (bpNSInfo != null) {
return bpNSInfo.getBlockPoolID();
} else {
@ -163,7 +163,7 @@ class BPOfferService {
}
@Override
public String toString() {
public synchronized String toString() {
if (bpNSInfo == null) {
// If we haven't yet connected to our NN, we don't yet know our
// own block pool ID.