Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ private[spark] class ExecutorAllocationManager(
if (stageIdToNumTasks.isEmpty) {
allocationManager.onSchedulerQueueEmpty()
if (numRunningTasks != 0) {
logWarning("No stages are running, but numRunningTasks != 0")
logWarning(s"No stages are running, but numRunningTasks = $numRunningTasks")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say

... but numRunningTasks ($numRunningTasks) != 0

numRunningTasks = 0
}
}
Expand Down Expand Up @@ -615,7 +615,11 @@ private[spark] class ExecutorAllocationManager(
val taskIndex = taskEnd.taskInfo.index
val stageId = taskEnd.stageId
allocationManager.synchronized {
numRunningTasks -= 1
if (numRunningTasks > 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, this seems like a band-aid though. Is this because the task-end event happens in the wrong order with the job end event? can we catch and guard for that case more directly?

numRunningTasks -= 1
} else {
logWarning("SparkListenerTaskEnd got, but numRunningTasks == 0")
}
// If the executor is no longer running any scheduled tasks, mark it as idle
if (executorIdToTaskIds.contains(executorId)) {
executorIdToTaskIds(executorId) -= taskId
Expand Down