Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/750#discussion_r46285468
--- 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 --
Again sticking to antiquated traditions is imho not a good option if one
can improve it. Including the change of `cancel's` `onComplete` would be ok for
me here. But in general, orthogonal changes should be included in a separate PR.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---