Skip to content
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

[SPARK-23326][WEBUI]schedulerDelay should return 0 when the task is running #20493

Closed
wants to merge 1 commit into from

Conversation

zsxwing
Copy link
Member

@zsxwing zsxwing commented Feb 3, 2018

What changes were proposed in this pull request?

When a task is still running, metrics like executorRunTime are not available. Then schedulerDelay will be almost the same as duration and that's confusing.

This PR makes schedulerDelay return 0 when the task is running which is the same behavior as 2.2.

How was this patch tested?

AppStatusUtilsSuite.schedulerDelay

Copy link
Contributor

@jiangxb1987 jiangxb1987 left a comment

Choose a reason for hiding this comment

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

LGTM

@SparkQA
Copy link

SparkQA commented Feb 3, 2018

Test build #87015 has finished for PR 20493 at commit 7889fb0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

class AppStatusUtilsSuite extends SparkFunSuite {

test("schedulerDelay") {
val runningTask = new TaskData(
Copy link
Member

@dongjoon-hyun dongjoon-hyun Feb 3, 2018

Choose a reason for hiding this comment

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

Can we make this test case more concise and easy to read by deduplication?
For the purpose of this test case, what about the following pattern?

Seq(("RUNNING", 0), ("SUCCESS", 3L)).foreach { case (status, schedulerDelay) =>
 // the code from `finishedTask`
}

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually there are many different values between these 2 code blocks

 +        executorDeserializeTime = 5L,
 +        executorDeserializeCpuTime = 3L,
 +        executorRunTime = 90L,
 +        executorCpuTime = 10L,
 +        resultSize = 100L,
 +        jvmGcTime = 10L,
 +        resultSerializationTime = 2L,

I think it's OK keep the code as it is.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I'm inclined to keep it as they are more real.

def schedulerDelay(task: TaskData): Long = {
if (task.taskMetrics.isDefined && task.duration.isDefined) {
if (isTaskFinished(task) && task.taskMetrics.isDefined && task.duration.isDefined) {
Copy link
Contributor

Choose a reason for hiding this comment

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

task.duration.isDefined should be redundant now, right?

(I remember the duration didn't use to be set for running tasks, so this code worked, but apparently it changed while I worked on these changes...)

Copy link
Contributor

Choose a reason for hiding this comment

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

Logically duration should be set for running tasks, to indicate how long a task has been run.

I feel it's safer to keep task.duration.isDefined, as we call task.duration.get below.

@cloud-fan
Copy link
Contributor

LGTM

@cloud-fan
Copy link
Contributor

thanks, merging to master/2.3!

asfgit pushed a commit that referenced this pull request Feb 6, 2018
…running

## What changes were proposed in this pull request?

When a task is still running, metrics like executorRunTime are not available. Then `schedulerDelay` will be almost the same as `duration` and that's confusing.

This PR makes `schedulerDelay` return 0 when the task is running which is the same behavior as 2.2.

## How was this patch tested?

`AppStatusUtilsSuite.schedulerDelay`

Author: Shixiong Zhu <[email protected]>

Closes #20493 from zsxwing/SPARK-23326.

(cherry picked from commit f3f1e14)
Signed-off-by: Wenchen Fan <[email protected]>
@asfgit asfgit closed this in f3f1e14 Feb 6, 2018
@zsxwing zsxwing deleted the SPARK-23326 branch February 6, 2018 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants