[
https://issues.apache.org/jira/browse/FLINK-6833?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16034717#comment-16034717
]
ASF GitHub Bot commented on FLINK-6833:
---------------------------------------
GitHub user tillrohrmann opened a pull request:
https://github.com/apache/flink/pull/4058
[FLINK-6833] [task] Fail StreamTask only due to async exception if it is
running
In order to resolve a race condition between a properly terminated
StreamTask which
cleans up its resources (stopping asynchronous operations, etc.) and a
cancelled
asynchronous operation (e.g. asynchronous checkpointing operation), we
check whether
the StreamTask is still running before failing it externally.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tillrohrmann/flink fixStreamTaskRaceCondition
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/4058.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #4058
----
commit 3d119a115e707e80b4b14174edd7de5048b732e9
Author: Till Rohrmann <[email protected]>
Date: 2017-06-02T13:48:54Z
[FLINK-6833] [task] Fail StreamTask only due to async exception if it is
running
In order to resolve a race condition between a properly terminated
StreamTask which
cleans up its resources (stopping asynchronous operations, etc.) and a
cancelled
asynchronous operation (e.g. asynchronous checkpointing operation), we
check whether
the StreamTask is still running before failing it externally.
----
> Race condition: Asynchronous checkpointing task can fail completed StreamTask
> -----------------------------------------------------------------------------
>
> Key: FLINK-6833
> URL: https://issues.apache.org/jira/browse/FLINK-6833
> Project: Flink
> Issue Type: Bug
> Components: Local Runtime, State Backends, Checkpointing
> Affects Versions: 1.3.0, 1.4.0
> Reporter: Till Rohrmann
> Assignee: Till Rohrmann
> Priority: Critical
>
> A {{StreamTask}} which is about to finish and thus transitioning its
> containing {{Task}} into the {{ExecutionState.FINISHED}} state, can be failed
> by a concurrent asynchronous checkpointing operation. The problem is that
> upon termination the {{StreamTask}} cancels all concurrent operations
> (amongst others ongoing asynchronous checkpoints). The cancellation of the
> async checkpoint triggers the {{StreamTask#handleAsyncException}} call which
> will fail the containing {{Task}}. If the {{handleAsyncException}} completes
> before the {{StreamTask}} has been properly terminated, then the containing
> {{Task}} will transition into {{ExecutionState.FAILED}} instead of
> {{ExecutionState.FINISHED}}.
> In order to resolve this race condition, we should check in the
> {{StreamTask#handleAsyncException}} whether the {{StreamTask}} is still
> running or has already been terminated. Only in the former case, we should
> fail the containing {{Task}}.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)