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-13901][CORE]correct the logDebug information when jump to the next locality level #11719

Closed
wants to merge 4 commits into from

Conversation

trueyao
Copy link
Contributor

@trueyao trueyao commented Mar 15, 2016

JIRA Issue:https://issues.apache.org/jira/browse/SPARK-13901
In getAllowedLocalityLevel method of TaskSetManager,we get wrong logDebug information when jump to the next locality level.So we should fix it.

@@ -557,7 +557,7 @@ private[spark] class TaskSetManager(
lastLaunchTime += localityWaits(currentLocalityIndex)
currentLocalityIndex += 1
logDebug(s"Moving to ${myLocalityLevels(currentLocalityIndex)} after waiting for " +
s"${localityWaits(currentLocalityIndex)}ms")
s"${localityWaits(currentLocalityIndex - 1)}ms")
Copy link
Member

Choose a reason for hiding this comment

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

Pull this out into a val above, use it above, and then just reuse it here. It's clearer

@trueyao
Copy link
Contributor Author

trueyao commented Mar 15, 2016

I'm really sorry to make extra commits...Are these codes clearer ?

} else if (curTime - lastLaunchTime >= localityWaits(currentLocalityIndex)) {
// Jump to the next locality level, and reset lastLaunchTime so that the next locality
// wait timer doesn't immediately expire
lastLaunchTime += localityWaits(currentLocalityIndex)
currentLocalityIndex += 1
logDebug(s"Moving to ${myLocalityLevels(currentLocalityIndex)} after waiting for " +
s"${localityWaits(currentLocalityIndex)}ms")
s"${localityWaits(previousLocalityIndex)}ms")
Copy link
Member

Choose a reason for hiding this comment

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

Ah OK, not quite what I meant. But, how about a slightly different idea. To match how the debug statement above works, leave it as-is, but then make this one:

logDebug(s"Moving to ${myLocalityLevels(currentLocalityIndex+1)} after waiting for " +                
  s"${localityWaits(currentLocalityIndex)}ms")
currentLocalityIndex += 1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh,I got it ,thank you for help.

@trueyao
Copy link
Contributor Author

trueyao commented Mar 16, 2016

@srowen Ready for another look.

@srowen
Copy link
Member

srowen commented Mar 16, 2016

Jenkins test this please

@SparkQA
Copy link

SparkQA commented Mar 16, 2016

Test build #53295 has finished for PR 11719 at commit 2eb75cb.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member

srowen commented Mar 16, 2016

Jenkins retest this please

@SparkQA
Copy link

SparkQA commented Mar 16, 2016

Test build #53307 has finished for PR 11719 at commit 2eb75cb.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@trueyao
Copy link
Contributor Author

trueyao commented Mar 16, 2016

The error of "java.lang.IllegalArgumentException: requirement failed" is confusing,I just exchange two lines of codes..Actually am I wrong ?

@srowen
Copy link
Member

srowen commented Mar 16, 2016

I'm certain this is an unrelated failure, but not sure why the failure occurs. It has happened on a few builds.

@@ -555,9 +555,9 @@ private[spark] class TaskSetManager(
// Jump to the next locality level, and reset lastLaunchTime so that the next locality
// wait timer doesn't immediately expire
lastLaunchTime += localityWaits(currentLocalityIndex)
currentLocalityIndex += 1
logDebug(s"Moving to ${myLocalityLevels(currentLocalityIndex)} after waiting for " +
logDebug(s"Moving to ${myLocalityLevels(currentLocalityIndex + 1)} after waiting for " +
Copy link
Contributor

Choose a reason for hiding this comment

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

haven't looked closely at this, but could currentLocalityIndex + 1 create an index out of bound for myLocalityLevels?

Copy link
Member

Choose a reason for hiding this comment

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

Before, it was incremented first and then used as an index, and now it's increment afterwards, so it shouldn't be different. Really the net change is for the second part of the message to refer to the previous index, so should be OK.

asfgit pushed a commit that referenced this pull request Mar 17, 2016
… next locality level

JIRA Issue:https://issues.apache.org/jira/browse/SPARK-13901
In getAllowedLocalityLevel method of TaskSetManager,we get wrong logDebug information when jump to the next locality level.So we should fix it.

Author: trueyao <501663994@qq.com>

Closes #11719 from trueyao/logDebug-localityWait.

(cherry picked from commit ea9ca6f)
Signed-off-by: Sean Owen <sowen@cloudera.com>
@asfgit asfgit closed this in ea9ca6f Mar 17, 2016
@trueyao trueyao deleted the logDebug-localityWait branch March 21, 2016 08:08
roygao94 pushed a commit to roygao94/spark that referenced this pull request Mar 22, 2016
… next locality level

JIRA Issue:https://issues.apache.org/jira/browse/SPARK-13901
In getAllowedLocalityLevel method of TaskSetManager,we get wrong logDebug information when jump to the next locality level.So we should fix it.

Author: trueyao <501663994@qq.com>

Closes apache#11719 from trueyao/logDebug-localityWait.
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.

4 participants