From 8bef26a6077f37b9b47690b1819510d488ddf321 Mon Sep 17 00:00:00 2001 From: Szilard Nemeth Date: Wed, 10 Jun 2020 18:01:20 +0200 Subject: [PATCH] YARN-10296. Make ContainerPBImpl#getId/setId synchronized. Contributed by Benjamin Teke --- .../hadoop/yarn/api/records/impl/pb/ContainerPBImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 47be2f030fb..1d7315b3ed3 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 @@ -63,7 +63,7 @@ public class ContainerPBImpl extends Container { viaProto = true; } - public ContainerProto getProto() { + synchronized public ContainerProto getProto() { mergeLocalToProto(); proto = viaProto ? proto : builder.build(); @@ -132,7 +132,7 @@ public class ContainerPBImpl extends Container { } @Override - public ContainerId getId() { + synchronized public ContainerId getId() { ContainerProtoOrBuilder p = viaProto ? proto : builder; if (this.containerId != null) { return this.containerId; @@ -166,7 +166,7 @@ public class ContainerPBImpl extends Container { } @Override - public void setId(ContainerId id) { + synchronized public void setId(ContainerId id) { maybeInitBuilder(); if (id == null) builder.clearId();