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

    https://github.com/apache/flink/pull/4058#discussion_r120757786
  
    --- Diff: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
 ---
    @@ -824,11 +824,14 @@ public ProcessingTimeService 
getProcessingTimeService() {
         * FAILED, and, if the invokable code is running, starts an 
asynchronous thread
         * that aborts that code.
         *
    -    * <p>This method never blocks.</p>
    +    * <p>This method never blocks.
         */
        @Override
        public void handleAsyncException(String message, Throwable exception) {
    -           getEnvironment().failExternally(exception);
    +           if (isRunning) {
    --- End diff --
    
    If `isRunning == true` when entering the if branch, then depending on what 
happens before `failExternally`, we can assume that the `handleAsyncException` 
either happened atomically before `isRunning` was set to `false` or not. But 
what we don't want to happen is that if `isRunning == false`, that we can still 
fail the task. Thus, I think it solves a valid problem.


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

Reply via email to