[
https://issues.apache.org/jira/browse/SPARK-19617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15872977#comment-15872977
]
Apache Spark commented on SPARK-19617:
--------------------------------------
User 'gf53520' has created a pull request for this issue:
https://github.com/apache/spark/pull/16980
> Fix the race condition when starting and stopping a query quickly
> -----------------------------------------------------------------
>
> Key: SPARK-19617
> URL: https://issues.apache.org/jira/browse/SPARK-19617
> Project: Spark
> Issue Type: Bug
> Components: Structured Streaming
> Affects Versions: 2.0.2, 2.1.0
> Reporter: Shixiong Zhu
> Assignee: Shixiong Zhu
> Fix For: 2.2.0
>
>
> The streaming thread in StreamExecution uses the following ways to check if
> it should exit:
> - Catch an InterruptException.
> - `StreamExecution.state` is TERMINATED.
> when starting and stopping a query quickly, the above two checks may both
> fail.
> - Hit [HADOOP-14084|https://issues.apache.org/jira/browse/HADOOP-14084] and
> swallow InterruptException
> - StreamExecution.stop is called before `state` becomes `ACTIVE`. Then
> [runBatches|https://github.com/apache/spark/blob/dcc2d540a53f0bd04baead43fdee1c170ef2b9f3/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/StreamExecution.scala#L252]
> changes the state from `TERMINATED` to `ACTIVE`.
> If the above cases both happen, the query will hang forever.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]