tillrohrmann commented on a change in pull request #10143: 
[FLINK-13184]Starting a TaskExecutor blocks the YarnResourceManager's main 
thread
URL: https://github.com/apache/flink/pull/10143#discussion_r353108583
 
 

 ##########
 File path: 
flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java
 ##########
 @@ -469,6 +460,46 @@ public void onError(Throwable error) {
                onFatalError(error);
        }
 
+       // 
------------------------------------------------------------------------
+       //  NMClientAsync CallbackHandler methods
+       // 
------------------------------------------------------------------------
+       @Override
+       public void onContainerStarted(ContainerId containerId, Map<String, 
ByteBuffer> map) {
+               log.debug("Succeed to call YARN Node Manager to start 
container", containerId);
+       }
+
+       @Override
+       public void onContainerStatusReceived(ContainerId containerId, 
ContainerStatus containerStatus) {
+               // We are not interested in getting container status
+       }
+
+       @Override
+       public void onContainerStopped(ContainerId containerId) {
+               log.debug("Succeed to call YARN Node Manager to stop 
container", containerId);
+       }
+
+       @Override
+       public void onStartContainerError(ContainerId containerId, Throwable 
throwable) {
+               log.error("Could not start TaskManager in container {}.", 
containerId, throwable);
+
+               final ResourceID resourceId = new 
ResourceID(containerId.toString());
+               // release the failed container
+               workerNodeMap.remove(resourceId);
+               resourceManagerClient.releaseAssignedContainer(containerId);
+               // and ask for a new one
+               requestYarnContainerIfRequired();
 
 Review comment:
   This section is problematic because it is not being executed in the actor's 
main thread. This can lead to data races/corruption.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to