diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/RollingLevelDBTimelineStore.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/RollingLevelDBTimelineStore.java index 8b6a51b..7d7db59 100644 --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/RollingLevelDBTimelineStore.java +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/RollingLevelDBTimelineStore.java @@ -1243,8 +1243,7 @@ private Long getStartTimeLong(String entityId, String entityType) * Get the unique start time for a given entity as a byte array that sorts the * timestamps in reverse order (see * {@link GenericObjectMapper#writeReverseOrderedLong(long)}). If the start - * time doesn't exist, set it based on the information provided. Should only - * be called when a lock has been obtained on the entity. + * time doesn't exist, set it based on the information provided. * * @param entityId * The id of the entity @@ -1257,8 +1256,9 @@ private Long getStartTimeLong(String entityId, String entityType) * @return A StartAndInsertTime * @throws IOException */ - private Long getAndSetStartTime(String entityId, String entityType, - Long startTime, List events) throws IOException { + private synchronized Long getAndSetStartTime(String entityId, + String entityType, Long startTime, List events) + throws IOException { EntityIdentifier entity = new EntityIdentifier(entityId, entityType); Long time = startTimeWriteCache.get(entity); if (time != null) {