flink-issues mailing list archives

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

    https://github.com/apache/flink/pull/750#discussion_r46206488
  
    --- 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 --
    
    Same pattern as `cancel` `onComplete` back-call (see line 901) -- I we change it, we should
change both. I would keep it. If you want to get it changed for both, let me know.


---
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