flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tillrohrmann <...@git.apache.org>
Subject [GitHub] flink pull request: [FLINK-2111] Add "stop" signal to cleanly shut...
Date Mon, 30 Nov 2015 17:17:16 GMT
Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/750#discussion_r46172807
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/Execution.java
---
    @@ -402,21 +405,53 @@ public void onComplete(Throwable failure, Object success) throws
Throwable {
     		}
     	}
     
    +	public void stop() {
    +		// sends stop RPC call
    +
    +		final SimpleSlot slot = this.assignedResource;
    +
    +		if (slot != null) {
    +			final ActorGateway gateway = slot.getInstance().getActorGateway();
    +
    +			Future<Object> stopResult = gateway.retry(
    +				new StopTask(attemptId),
    +				NUM_STOP_CALL_TRIES,
    +				timeout,
    +				executionContext);
    +
    +			stopResult.onComplete(new OnComplete<Object>() {
    +				@Override
    +				public void onComplete(Throwable failure, Object success) throws Throwable {
    +					if (failure != null) {
    +						fail(new Exception("Task could not be stopped.", failure));
    +					} else {
    +						TaskOperationResult result = (TaskOperationResult) success;
    +						if (!result.success()) {
    +							LOG.debug("Stopping task call did not find task. Probably akka message call race.");
    --- End diff --
    
    Also on `INFO` level.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message