diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerPBImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerPBImpl.java index b3dad0a016..53d52d3c94 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerPBImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerPBImpl.java @@ -68,7 +68,7 @@ public ContainerPBImpl(ContainerProto proto) { viaProto = true; } - public ContainerProto getProto() { + synchronized public ContainerProto getProto() { mergeLocalToProto(); proto = viaProto ? proto : builder.build(); @@ -142,7 +142,7 @@ private void maybeInitBuilder() { } @Override - public ContainerId getId() { + synchronized public ContainerId getId() { ContainerProtoOrBuilder p = viaProto ? proto : builder; if (this.containerId != null) { return this.containerId; @@ -176,7 +176,7 @@ public NodeId getNodeId() { } @Override - public void setId(ContainerId id) { + synchronized public void setId(ContainerId id) { maybeInitBuilder(); if (id == null) builder.clearId();