Skip to content
This repository was archived by the owner on Apr 5, 2022. It is now read-only.

Commit 8632e38

Browse files
committed
Fix possible race condition
- Change call to onContainerCompleted happening after container has been removed to limit possibilities for impl ending with race conditions. - SHDP-561
1 parent 5fb330e commit 8632e38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-yarn/spring-yarn-core/src/main/java/org/springframework/yarn/am/AbstractEventingAppmaster.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2014 the original author or authors.
2+
* Copyright 2013-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -86,11 +86,11 @@ public void onApplicationEvent(AbstractYarnEvent event) {
8686
onContainerLaunchRequestFailed(((ContainerLaunchRequestFailedEvent) event).getContainer());
8787
} else if (event instanceof ContainerCompletedEvent) {
8888
ContainerStatus containerStatus = ((ContainerCompletedEvent) event).getContainerStatus();
89-
onContainerCompleted(containerStatus);
9089
Container container = runningContainers.remove(containerStatus.getContainerId());
9190
if (container != null) {
9291
registeredContainers.remove(container);
9392
}
93+
onContainerCompleted(containerStatus);
9494
} else if (event instanceof ContainerRegisterEvent) {
9595
ContainerRegisterEvent e = (ContainerRegisterEvent) event;
9696
ContainerId containerId = ConverterUtils.toContainerId(e.getContainerId());

0 commit comments

Comments
 (0)