-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-24677][Core]Avoid NoSuchElementException from MedianHeap #21656
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
Changes from 2 commits
467f0bc
55ddbeb
3d6682f
d8fdceb
1c1df5c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -772,6 +772,12 @@ private[spark] class TaskSetManager( | |
| private[scheduler] def markPartitionCompleted(partitionId: Int): Unit = { | ||
| partitionToIndex.get(partitionId).foreach { index => | ||
| if (!successful(index)) { | ||
| if (speculationEnabled) { | ||
|
||
| taskAttempts(index).headOption.map { info => | ||
| info.markFinished(TaskState.FINISHED, clock.getTimeMillis()) | ||
| successfulTaskDurations.insert(info.duration) | ||
|
||
| } | ||
| } | ||
| tasksSuccessful += 1 | ||
| successful(index) = true | ||
| if (tasksSuccessful == numTasks) { | ||
|
|
||
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.
IIUC in this case no task in this taskSet actually successfully finishes, it's another task attempt from another taskSet for the same stage that succeeded. In stead of changing this code path, I'd suggest we have another flag to show whether any task succeeded in current taskSet, and if no task have succeeded, skip L987.
WDYT @squito ?
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.
yeah that is sort of what I was suggesting -- but I was thinking rather than just a flag, maybe we separate out
tasksSuccessfulintotasksCompletedSuccessfully(from this taskset) andtasksNoLongerNecessary(from any taskset), perhaps with better names. If you just had a flag, you would avoid the exception from the empty heap, but you still might decide to enable speculation prematurely as you really haven't finished enough forSPECULATION_QUANTILE:spark/core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala
Line 987 in a381bce