You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by zhangminglei <gi...@git.apache.org> on 2018/05/28 08:25:39 UTC

[GitHub] flink pull request #6087: [FLINK-9410] [yarn] Replace NMClient with NMClient...

GitHub user zhangminglei opened a pull request:

    https://github.com/apache/flink/pull/6087

    [FLINK-9410] [yarn] Replace NMClient with NMClientAsync in YarnResour…

    …ceManager
    
    
    *Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
    
    *Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
    
    ## Contribution Checklist
    
      - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
      
      - Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
      Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
    
      - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
      
      - Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Travis CI to do that following [this guide](http://flink.apache.org/contribute-code.html#best-practices).
    
      - Each pull request should address only one issue, not mix up code from multiple issues.
      
      - Each commit in the pull request has a meaningful commit message (including the JIRA id)
    
      - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
    
    
    **(The sections below can be removed for hotfixes of typos)**
    
    ## What is the purpose of the change
    
    *(For example: This pull request makes task deployment go through the blob server, rather than through RPC. That way we avoid re-transferring them on each deployment (during recovery).)*
    
    
    ## Brief change log
    
    *(for example:)*
      - *The TaskInfo is stored in the blob store on job creation time as a persistent artifact*
      - *Deployments RPC transmits only the blob storage reference*
      - *TaskManagers retrieve the TaskInfo from the blob cache*
    
    
    ## Verifying this change
    
    *(Please pick either of the following options)*
    
    This change is a trivial rework / code cleanup without any test coverage.
    
    *(or)*
    
    This change is already covered by existing tests, such as *(please describe tests)*.
    
    *(or)*
    
    This change added tests and can be verified as follows:
    
    *(example:)*
      - *Added integration tests for end-to-end deployment with large payloads (100MB)*
      - *Extended integration test for recovery after master (JobManager) failure*
      - *Added test that validates that TaskInfo is transferred only once across recoveries*
      - *Manually verified the change by running a 4 node cluser with 2 JobManagers and 4 TaskManagers, a stateful streaming program, and killing one JobManager and two TaskManagers during the execution, verifying that recovery happens correctly.*
    
    ## Does this pull request potentially affect one of the following parts:
    
      - Dependencies (does it add or upgrade a dependency): (yes / no)
      - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / no)
      - The serializers: (yes / no / don't know)
      - The runtime per-record code paths (performance sensitive): (yes / no / don't know)
      - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (yes / no / don't know)
      - The S3 file system connector: (yes / no / don't know)
    
    ## Documentation
    
      - Does this pull request introduce a new feature? (yes / no)
      - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zhangminglei/flink flink-9410-asyncclient

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/6087.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #6087
    
----
commit 4d59d6dc4a2be37e6323e76cb8a1eeb3db36d929
Author: zhangminglei <zm...@...>
Date:   2018-05-28T08:24:08Z

    [FLINK-9410] [yarn] Replace NMClient with NMClientAsync in YarnResourceManager

----


---

[GitHub] flink issue #6087: [FLINK-9410] [yarn] Replace NMClient with NMClientAsync i...

Posted by tillrohrmann <gi...@git.apache.org>.
Github user tillrohrmann commented on the issue:

    https://github.com/apache/flink/pull/6087
  
    Thanks for opening the PR @zhangminglei. I agree with @sihuazhou that it's not as easy as replacing `x` with `xAsync`. As @sihuazhou pointed out, we have to react to asynchronous Yarn messages depending on our internal state. So for example, when calling `startContainerAsync` we should store somewhere that we tried to start a container. If this request later fails, we should not fail the complete ResourceManager but rather send a new container request (as it is done in the `YarnResourceManager#onContainersAllocated` method).
    
    Additionally, while touching this code, we should check whether we can improve the unit tests for this component. Especially with the asynchronous node manager client, it should be rather simple to write good tests when creating a mock implementation and manually calling the callbacks.


---

[GitHub] flink pull request #6087: [FLINK-9410] [yarn] Replace NMClient with NMClient...

Posted by sihuazhou <gi...@git.apache.org>.
Github user sihuazhou commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6087#discussion_r191162993
  
    --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java ---
    @@ -212,13 +214,12 @@ private void getContainersFromPreviousAttempts(final RegisterApplicationMasterRe
     		}
     	}
     
    -	protected NMClient createAndStartNodeManagerClient(YarnConfiguration yarnConfiguration) {
    -		// create the client to communicate with the node managers
    -		NMClient nodeManagerClient = NMClient.createNMClient();
    -		nodeManagerClient.init(yarnConfiguration);
    -		nodeManagerClient.start();
    -		nodeManagerClient.cleanupRunningContainersOnStop(true);
    -		return nodeManagerClient;
    +	protected NMClientAsync createAndStartNodeManagerClient(YarnConfiguration yarnConfiguration) {
    +		// create the client to communicate with the node managers.
    +		NMClientAsync nodeManagerAsyncClient = NMClientAsync.createNMClientAsync(new NMClientAsyncCallbackHandler());
    +		nodeManagerAsyncClient.init(yarnConfiguration);
    +		nodeManagerAsyncClient.start();
    --- End diff --
    
    Maybe we should also call this `nodeManagerClient.getClient().cleanupRunningContainersOnStop(true);`.


---

[GitHub] flink pull request #6087: [FLINK-9410] [yarn] Replace NMClient with NMClient...

Posted by zhangminglei <gi...@git.apache.org>.
Github user zhangminglei commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6087#discussion_r191166133
  
    --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java ---
    @@ -212,13 +214,12 @@ private void getContainersFromPreviousAttempts(final RegisterApplicationMasterRe
     		}
     	}
     
    -	protected NMClient createAndStartNodeManagerClient(YarnConfiguration yarnConfiguration) {
    -		// create the client to communicate with the node managers
    -		NMClient nodeManagerClient = NMClient.createNMClient();
    -		nodeManagerClient.init(yarnConfiguration);
    -		nodeManagerClient.start();
    -		nodeManagerClient.cleanupRunningContainersOnStop(true);
    -		return nodeManagerClient;
    +	protected NMClientAsync createAndStartNodeManagerClient(YarnConfiguration yarnConfiguration) {
    +		// create the client to communicate with the node managers.
    +		NMClientAsync nodeManagerAsyncClient = NMClientAsync.createNMClientAsync(new NMClientAsyncCallbackHandler());
    +		nodeManagerAsyncClient.init(yarnConfiguration);
    +		nodeManagerAsyncClient.start();
    --- End diff --
    
    I am not very sure about this. But I will change it now.


---

[GitHub] flink issue #6087: [FLINK-9410] [yarn] Replace NMClient with NMClientAsync i...

Posted by sihuazhou <gi...@git.apache.org>.
Github user sihuazhou commented on the issue:

    https://github.com/apache/flink/pull/6087
  
    Hi @zhangminglei , I would suggest to retry, this is more consistent with the behavior when we are using the sync API, in fact, currently if we don't retry to start container then the job will fail to acquire slots, and RM will also stop to start container for the jobs that are waiting for slots.


---

[GitHub] flink pull request #6087: [FLINK-9410] [yarn] Replace NMClient with NMClient...

Posted by zhangminglei <gi...@git.apache.org>.
Github user zhangminglei commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6087#discussion_r191165652
  
    --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java ---
    @@ -510,4 +509,39 @@ private int generatePriority(ResourceProfile resourceProfile) {
     		}
     	}
     
    +	/**
    +	 * Implements NMClientAsyncCallbackHandler.
    +	 */
    +	private class NMClientAsyncCallbackHandler implements NMClientAsync.CallbackHandler {
    +
    +		@Override
    +		public void onContainerStarted(ContainerId containerId, Map<String, ByteBuffer> allServiceResponse) {
    +
    +		}
    +
    +		@Override
    +		public void onContainerStatusReceived(ContainerId containerId, ContainerStatus containerStatus) {
    +
    +		}
    +
    +		@Override
    +		public void onContainerStopped(ContainerId containerId) {
    +
    --- End diff --
    
    Okay. Will change.


---

[GitHub] flink pull request #6087: [FLINK-9410] [yarn] Replace NMClient with NMClient...

Posted by sihuazhou <gi...@git.apache.org>.
Github user sihuazhou commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6087#discussion_r192733087
  
    --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java ---
    @@ -406,6 +407,43 @@ public void onError(Throwable error) {
     		onFatalError(error);
     	}
     
    +	@Override
    +	public void onContainerStarted(ContainerId containerId, Map<String, ByteBuffer> allServiceResponse) {
    +		log.info("The container {} started.", containerId);
    +	}
    +
    +	@Override
    +	public void onContainerStatusReceived(ContainerId containerId, ContainerStatus containerStatus) {
    +	}
    +
    +	@Override
    +	public void onContainerStopped(ContainerId containerId) {
    +		log.info("The container {} is stopped.", containerId);
    +	}
    +
    +	@Override
    +	public void onStartContainerError(ContainerId containerId, Throwable t) {
    +		log.error("Could not start TaskManager in container {}.", containerId, t);
    +
    +		// release the failed container
    +		YarnWorkerNode yarnWorkerNode = workerNodeMap.remove(new ResourceID(containerId.toString()));
    +		resourceManagerClient.releaseAssignedContainer(containerId);
    +		// ask for a new one
    +		requestYarnContainer(yarnWorkerNode.getContainer().getResource(), yarnWorkerNode.getContainer().getPriority());
    +	}
    +
    +	@Override
    +	public void onGetContainerStatusError(ContainerId containerId, Throwable t) {
    +		log.error("Error occurred during get the container {} status.", containerId, t);
    +		onFatalError(t);
    +	}
    +
    +	@Override
    +	public void onStopContainerError(ContainerId containerId, Throwable t) {
    +		log.error("Error occurred during stop the container {}.", containerId, t);
    +		onFatalError(t);
    --- End diff --
    
    some above.


---

[GitHub] flink pull request #6087: [FLINK-9410] [yarn] Replace NMClient with NMClient...

Posted by zhangminglei <gi...@git.apache.org>.
Github user zhangminglei commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6087#discussion_r192728317
  
    --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java ---
    @@ -356,7 +363,8 @@ public void onContainersAllocated(List<Container> containers) {
     
     					final String containerIdStr = container.getId().toString();
     					final ResourceID resourceId = new ResourceID(containerIdStr);
    -
    +					this.resourceId = resourceId;
    +					this.container = container;
    --- End diff --
    
    Yes. Thanks, I know what is wrong with my code.Will change.


---

[GitHub] flink pull request #6087: [FLINK-9410] [yarn] Replace NMClient with NMClient...

Posted by sihuazhou <gi...@git.apache.org>.
Github user sihuazhou commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6087#discussion_r191162507
  
    --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java ---
    @@ -510,4 +509,39 @@ private int generatePriority(ResourceProfile resourceProfile) {
     		}
     	}
     
    +	/**
    +	 * Implements NMClientAsyncCallbackHandler.
    +	 */
    +	private class NMClientAsyncCallbackHandler implements NMClientAsync.CallbackHandler {
    +
    +		@Override
    +		public void onContainerStarted(ContainerId containerId, Map<String, ByteBuffer> allServiceResponse) {
    +
    +		}
    +
    +		@Override
    +		public void onContainerStatusReceived(ContainerId containerId, ContainerStatus containerStatus) {
    +
    +		}
    +
    +		@Override
    +		public void onContainerStopped(ContainerId containerId) {
    +
    --- End diff --
    
    I would suggest to add some log here.


---

[GitHub] flink pull request #6087: [FLINK-9410] [yarn] Replace NMClient with NMClient...

Posted by zhangminglei <gi...@git.apache.org>.
Github user zhangminglei commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6087#discussion_r192736862
  
    --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java ---
    @@ -406,6 +407,43 @@ public void onError(Throwable error) {
     		onFatalError(error);
     	}
     
    +	@Override
    +	public void onContainerStarted(ContainerId containerId, Map<String, ByteBuffer> allServiceResponse) {
    +		log.info("The container {} started.", containerId);
    +	}
    +
    +	@Override
    +	public void onContainerStatusReceived(ContainerId containerId, ContainerStatus containerStatus) {
    +	}
    +
    +	@Override
    +	public void onContainerStopped(ContainerId containerId) {
    +		log.info("The container {} is stopped.", containerId);
    +	}
    +
    +	@Override
    +	public void onStartContainerError(ContainerId containerId, Throwable t) {
    +		log.error("Could not start TaskManager in container {}.", containerId, t);
    +
    +		// release the failed container
    +		YarnWorkerNode yarnWorkerNode = workerNodeMap.remove(new ResourceID(containerId.toString()));
    +		resourceManagerClient.releaseAssignedContainer(containerId);
    +		// ask for a new one
    +		requestYarnContainer(yarnWorkerNode.getContainer().getResource(), yarnWorkerNode.getContainer().getPriority());
    +	}
    +
    +	@Override
    +	public void onGetContainerStatusError(ContainerId containerId, Throwable t) {
    +		log.error("Error occurred during get the container {} status.", containerId, t);
    +		onFatalError(t);
    --- End diff --
    
    change


---

[GitHub] flink pull request #6087: [FLINK-9410] [yarn] Replace NMClient with NMClient...

Posted by sihuazhou <gi...@git.apache.org>.
Github user sihuazhou commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6087#discussion_r192733056
  
    --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java ---
    @@ -406,6 +407,43 @@ public void onError(Throwable error) {
     		onFatalError(error);
     	}
     
    +	@Override
    +	public void onContainerStarted(ContainerId containerId, Map<String, ByteBuffer> allServiceResponse) {
    +		log.info("The container {} started.", containerId);
    +	}
    +
    +	@Override
    +	public void onContainerStatusReceived(ContainerId containerId, ContainerStatus containerStatus) {
    +	}
    +
    +	@Override
    +	public void onContainerStopped(ContainerId containerId) {
    +		log.info("The container {} is stopped.", containerId);
    +	}
    +
    +	@Override
    +	public void onStartContainerError(ContainerId containerId, Throwable t) {
    +		log.error("Could not start TaskManager in container {}.", containerId, t);
    +
    +		// release the failed container
    +		YarnWorkerNode yarnWorkerNode = workerNodeMap.remove(new ResourceID(containerId.toString()));
    +		resourceManagerClient.releaseAssignedContainer(containerId);
    +		// ask for a new one
    +		requestYarnContainer(yarnWorkerNode.getContainer().getResource(), yarnWorkerNode.getContainer().getPriority());
    +	}
    +
    +	@Override
    +	public void onGetContainerStatusError(ContainerId containerId, Throwable t) {
    +		log.error("Error occurred during get the container {} status.", containerId, t);
    +		onFatalError(t);
    --- End diff --
    
    I think maybe this is not a fatal error.


---

[GitHub] flink issue #6087: [FLINK-9410] [yarn] Replace NMClient with NMClientAsync i...

Posted by sihuazhou <gi...@git.apache.org>.
Github user sihuazhou commented on the issue:

    https://github.com/apache/flink/pull/6087
  
    Hi @zhangminglei , do you want to take over this? if yes, plz free feel to take over this. I had a brief look at the code, I think this may not as easy as replace all api() to apiAsync(), e.g. maybe you also need to do some retry things in the `onStartContainerError()` of `NMClientAsync`.


---

[GitHub] flink pull request #6087: [FLINK-9410] [yarn] Replace NMClient with NMClient...

Posted by zhangminglei <gi...@git.apache.org>.
Github user zhangminglei commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6087#discussion_r191165600
  
    --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java ---
    @@ -510,4 +509,39 @@ private int generatePriority(ResourceProfile resourceProfile) {
     		}
     	}
     
    +	/**
    +	 * Implements NMClientAsyncCallbackHandler.
    +	 */
    +	private class NMClientAsyncCallbackHandler implements NMClientAsync.CallbackHandler {
    --- End diff --
    
    Yea. Will change.


---

[GitHub] flink issue #6087: [FLINK-9410] [yarn] Replace NMClient with NMClientAsync i...

Posted by zhangminglei <gi...@git.apache.org>.
Github user zhangminglei commented on the issue:

    https://github.com/apache/flink/pull/6087
  
    Hi, @sihuazhou . Thank you for your feedback. I would do not think retry here since error has occurred. we should tell the user the exception. I am not very sure the corresponding error whether need retry. @tillrohrmann  Could you take also look on this PR ? Thanks .


---

[GitHub] flink issue #6087: [FLINK-9410] [yarn] Replace NMClient with NMClientAsync i...

Posted by zhangminglei <gi...@git.apache.org>.
Github user zhangminglei commented on the issue:

    https://github.com/apache/flink/pull/6087
  
    Hi, @tillrohrmann  Could you also take another look on this PR ? If the code wrong, please let me know. and I will give a quick fix. Thank you!


---

[GitHub] flink pull request #6087: [FLINK-9410] [yarn] Replace NMClient with NMClient...

Posted by sihuazhou <gi...@git.apache.org>.
Github user sihuazhou commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6087#discussion_r192732891
  
    --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java ---
    @@ -406,6 +407,43 @@ public void onError(Throwable error) {
     		onFatalError(error);
     	}
     
    +	@Override
    +	public void onContainerStarted(ContainerId containerId, Map<String, ByteBuffer> allServiceResponse) {
    +		log.info("The container {} started.", containerId);
    +	}
    +
    +	@Override
    +	public void onContainerStatusReceived(ContainerId containerId, ContainerStatus containerStatus) {
    +	}
    +
    +	@Override
    +	public void onContainerStopped(ContainerId containerId) {
    +		log.info("The container {} is stopped.", containerId);
    +	}
    +
    +	@Override
    +	public void onStartContainerError(ContainerId containerId, Throwable t) {
    +		log.error("Could not start TaskManager in container {}.", containerId, t);
    +
    +		// release the failed container
    +		YarnWorkerNode yarnWorkerNode = workerNodeMap.remove(new ResourceID(containerId.toString()));
    --- End diff --
    
    Maybe it safer to check whether yarnWorkerNode is null.


---

[GitHub] flink pull request #6087: [FLINK-9410] [yarn] Replace NMClient with NMClient...

Posted by sihuazhou <gi...@git.apache.org>.
Github user sihuazhou commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6087#discussion_r192723013
  
    --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java ---
    @@ -356,7 +363,8 @@ public void onContainersAllocated(List<Container> containers) {
     
     					final String containerIdStr = container.getId().toString();
     					final ResourceID resourceId = new ResourceID(containerIdStr);
    -
    +					this.resourceId = resourceId;
    +					this.container = container;
    --- End diff --
    
    I think we can't do it like this, the `resourceId` will be reset by another request... as well as the `contianer`


---

[GitHub] flink pull request #6087: [FLINK-9410] [yarn] Replace NMClient with NMClient...

Posted by sihuazhou <gi...@git.apache.org>.
Github user sihuazhou commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6087#discussion_r191162395
  
    --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java ---
    @@ -510,4 +509,39 @@ private int generatePriority(ResourceProfile resourceProfile) {
     		}
     	}
     
    +	/**
    +	 * Implements NMClientAsyncCallbackHandler.
    +	 */
    +	private class NMClientAsyncCallbackHandler implements NMClientAsync.CallbackHandler {
    --- End diff --
    
    Maybe we could let YarnResourceManager to implement this interface, as it has implemented the `AMRMClientAsync.CallbackHandler`.


---

[GitHub] flink pull request #6087: [FLINK-9410] [yarn] Replace NMClient with NMClient...

Posted by zhangminglei <gi...@git.apache.org>.
Github user zhangminglei commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6087#discussion_r192736809
  
    --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java ---
    @@ -406,6 +407,43 @@ public void onError(Throwable error) {
     		onFatalError(error);
     	}
     
    +	@Override
    +	public void onContainerStarted(ContainerId containerId, Map<String, ByteBuffer> allServiceResponse) {
    +		log.info("The container {} started.", containerId);
    +	}
    +
    +	@Override
    +	public void onContainerStatusReceived(ContainerId containerId, ContainerStatus containerStatus) {
    +	}
    +
    +	@Override
    +	public void onContainerStopped(ContainerId containerId) {
    +		log.info("The container {} is stopped.", containerId);
    +	}
    +
    +	@Override
    +	public void onStartContainerError(ContainerId containerId, Throwable t) {
    +		log.error("Could not start TaskManager in container {}.", containerId, t);
    +
    +		// release the failed container
    +		YarnWorkerNode yarnWorkerNode = workerNodeMap.remove(new ResourceID(containerId.toString()));
    +		resourceManagerClient.releaseAssignedContainer(containerId);
    +		// ask for a new one
    +		requestYarnContainer(yarnWorkerNode.getContainer().getResource(), yarnWorkerNode.getContainer().getPriority());
    +	}
    +
    +	@Override
    +	public void onGetContainerStatusError(ContainerId containerId, Throwable t) {
    +		log.error("Error occurred during get the container {} status.", containerId, t);
    +		onFatalError(t);
    +	}
    +
    +	@Override
    +	public void onStopContainerError(ContainerId containerId, Throwable t) {
    +		log.error("Error occurred during stop the container {}.", containerId, t);
    +		onFatalError(t);
    --- End diff --
    
    change.


---

[GitHub] flink pull request #6087: [FLINK-9410] [yarn] Replace NMClient with NMClient...

Posted by zhangminglei <gi...@git.apache.org>.
Github user zhangminglei commented on a diff in the pull request:

    https://github.com/apache/flink/pull/6087#discussion_r192736907
  
    --- Diff: flink-yarn/src/main/java/org/apache/flink/yarn/YarnResourceManager.java ---
    @@ -406,6 +407,43 @@ public void onError(Throwable error) {
     		onFatalError(error);
     	}
     
    +	@Override
    +	public void onContainerStarted(ContainerId containerId, Map<String, ByteBuffer> allServiceResponse) {
    +		log.info("The container {} started.", containerId);
    +	}
    +
    +	@Override
    +	public void onContainerStatusReceived(ContainerId containerId, ContainerStatus containerStatus) {
    +	}
    +
    +	@Override
    +	public void onContainerStopped(ContainerId containerId) {
    +		log.info("The container {} is stopped.", containerId);
    +	}
    +
    +	@Override
    +	public void onStartContainerError(ContainerId containerId, Throwable t) {
    +		log.error("Could not start TaskManager in container {}.", containerId, t);
    +
    +		// release the failed container
    +		YarnWorkerNode yarnWorkerNode = workerNodeMap.remove(new ResourceID(containerId.toString()));
    --- End diff --
    
    Will change.


---