Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/750#discussion_r49462409
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/Task.java ---
    @@ -742,10 +743,38 @@ private void notifyFatalError(String message, 
Throwable cause) {
        }
     
        // 
----------------------------------------------------------------------------------------------------------------
    -   //  Canceling / Failing the task from the outside
    +   //  Stopping / Canceling / Failing the task from the outside
        // 
----------------------------------------------------------------------------------------------------------------
     
        /**
    +    * Stops the executing task by calling {@link Stoppable#stop()}.
    +    * <p>
    +    * This method never blocks.
    +    * </p>
    +    * 
    +    * @throws UnsupportedOperationException
    +    *             if the {@link AbstractInvokable} does not implement 
{@link Stoppable}
    +    */
    +   public void stopExecution() throws UnsupportedOperationException {
    +           LOG.info("Attempting to stop task " + taskNameWithSubtask);
    +           if(this.invokable instanceof Stoppable) {
    +                   Runnable runnable = new Runnable() {
    +                           @Override
    +                           public void run() {
    +                                   try {
    +                                           
((Stoppable)Task.this.invokable).stop();
    +                                   } catch(RuntimeException e) {
    +                                           LOG.error("Stopping task " + 
taskNameWithSubtask + " failed.", e);
    --- End diff --
    
    Shouldn't a `RuntimeException` cause the task to fail? We should notify the 
`JobManager` about this and fail the corresponding task. E.g. we could send a 
`FailTask` message to the `TaskManager` to fail the task.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to