GitHub user zhaorongsheng opened a pull request:
https://github.com/apache/spark/pull/16394
[SPARK-18981][Core]The job hang problem when speculation is on
## What changes were proposed in this pull request?
The root cause of this issue is that `ExecutorAllocationListener` gets the
speculated task end info after the stage end event handling which let
`numRunningTasks = 0`. Then it let `numRunningTasks -= 1` so the
#numRunningTasks is negative. When calculate #maxNeeded in method
`maxNumExecutorsNeeded()`, the value may be 0 or negative. So
`ExecutorAllocationManager` does not request container and the job will be hung.
This PR changes the method `onTaskEnd()` in `ExecutorAllocationListener`.
When `stageIdToNumTasks` contains the taskEnd's stageId, let #numRunningTasks
minus 1.
## How was this patch tested?
This patch was tested in the method `test("SPARK-18981...)` of
ExecutorAllocationManagerSuite.scala.
Create two taskInfos and one of them is speculated task. After the stage
ending event, the speculated task ending event is posted to listener.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zhaorongsheng/spark branch-18981-1
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/16394.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 #16394
----
commit c0220aefb1689731144dafccb001860276ee8d22
Author: roncen.zhao <[email protected]>
Date: 2016-12-24T02:37:53Z
resolve the job hang problem when speculation is on
----
---
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.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]