Github user aljoscha commented on a diff in the pull request:
https://github.com/apache/flink/pull/750#discussion_r38507948
--- Diff:
flink-runtime/src/main/scala/org/apache/flink/runtime/taskmanager/TaskManager.scala
---
@@ -411,6 +411,23 @@ class TaskManager(
log.debug(s"Cannot find task to fail for execution
${executionID})")
}
+ // stops a task
+ case StopTask(executionID) =>
+ val task = runningTasks.get(executionID)
+ if (task != null) {
+ try {
+ task.stopExecution()
--- End diff --
I agree with @mjsax that the cancel should be non-blocking. The method
seems to be badly named, it should maybe have been named `stop()` from the
beginning. Then it would be more obvious that is is just used for shutting down
the source, no matter what the reason might be.
Unfortunately `close()` is also taken as part of `RichFunction`.
I think we have two options, keep `cancel` and use it for stopping, no
matter what the reason is. Or rename it to `stop()` and use it in the same way
to make it clearer what it does.
---
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.
---