-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-18981][Core]The job hang problem when speculation is on #16389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
mridulm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I dont think the change itself might be incorrect : did you see
'No stages are running, but numRunningTasks != 0' in the logs ?
| val taskInfo = createTaskInfo(1, 1, "executor-1") | ||
| val speculatedTaskInfo = createTaskInfo(2, 1, "executor-1") | ||
| sc.listenerBus.postToAll(SparkListenerTaskStart(0, 0, taskInfo)) | ||
| assert(maxNumExecutorsNeeded(manager) === 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tests looks wrong - taskIndex is higher than numTasks ?
Would be better for the test to :
- Launch stage with 1 task.
- Launch a normal task and 1 speculative task - with same taskIndex, but different taskId's
- Finish normal task.
- Ensure stage is completed.
- Now finish speculative task and check if bug is not reproduced (it should be reproduced without this fix).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the warning info 'No stages are running, but numRunningTasks != 0' is printed and at that time the #numRunningTasks is set to 0. But after that the speculated task end event is arrived and the #numRunningTasks will plus 1.
The tests are wrong, I will fix it.
|
Hi @mridulm . I have modified the tests. Please check it. |
|
Jenkins, retest this please |
|
Does it fail in master without the fix ? |
|
Yes, I have checked it. |
|
@mridulm Please check it. Thanks~ |
|
Hi, can anyone check this PR? |
|
Can we just not reset |
|
@zsxwing I think it may cause some other problem. |
|
@zhaorongsheng |
|
@zhaorongsheng, is this still active and any opinion on ^? |
## What changes were proposed in this pull request? This PR proposes to close PRs ... - inactive to the review comments more than a month - WIP and inactive more than a month - with Jenkins build failure but inactive more than a month - suggested to be closed and no comment against that - obviously looking inappropriate (e.g., Branch 0.5) To make sure, I left a comment for each PR about a week ago and I could not have a response back from the author in these PRs below: Closes apache#11129 Closes apache#12085 Closes apache#12162 Closes apache#12419 Closes apache#12420 Closes apache#12491 Closes apache#13762 Closes apache#13837 Closes apache#13851 Closes apache#13881 Closes apache#13891 Closes apache#13959 Closes apache#14091 Closes apache#14481 Closes apache#14547 Closes apache#14557 Closes apache#14686 Closes apache#15594 Closes apache#15652 Closes apache#15850 Closes apache#15914 Closes apache#15918 Closes apache#16285 Closes apache#16389 Closes apache#16652 Closes apache#16743 Closes apache#16893 Closes apache#16975 Closes apache#17001 Closes apache#17088 Closes apache#17119 Closes apache#17272 Closes apache#17971 Added: Closes apache#17778 Closes apache#17303 Closes apache#17872 ## How was this patch tested? N/A Author: hyukjinkwon <[email protected]> Closes apache#18017 from HyukjinKwon/close-inactive-prs.
What changes were proposed in this pull request?
The root cause of this issue is that
ExecutorAllocationListenergets the speculated task end info after the stage end event handling which letnumRunningTasks = 0. Then it letnumRunningTasks -= 1so the #numRunningTasks is negative. When calculate #maxNeeded in methodmaxNumExecutorsNeeded(), the value may be 0 or negative. SoExecutorAllocationManagerdoes not request container and the job will be hung.This PR changes the method
onTaskEnd()inExecutorAllocationListener. WhenstageIdToNumTaskscontains 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.