-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-19793] Use clock.getTimeMillis when mark task as finished in TaskSetManager. #17133
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
|
Test build #73749 has finished for PR 17133 at commit
|
|
CC @devaraj-kavali and possibly @zsxwing ? |
vanzin
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.
Other than the cryptic comments, looks ok to me.
| val info = taskInfos(tid) | ||
| val index = info.index | ||
| info.markFinished(TaskState.FINISHED) | ||
| // Mark task as finished. Note that finishing time here should be bigger than 0. |
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.
I'm not sure what this comment is trying to say, especially since there's no check anywhere for "finishing time > 0" in the code here.
Also, grammar nit: it should be "larger than 0".
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.
Thanks for review :) what I want to say is that finishTime of TaskInfo should be set larger than 0(when do unit test), otherwise TaskInfo.finishTime will return false. I removed the comments and added an assert inside TaskInfo.
|
Test build #73795 has finished for PR 17133 at commit
|
|
Test build #73807 has finished for PR 17133 at commit
|
|
|
||
| private[spark] def markFinished(state: TaskState, time: Long = System.currentTimeMillis) { | ||
| // finishTime should be set larger than 0, otherwise "finished" below will return false. | ||
| assert(time != 0) |
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.
Nit: shouldn't you then assert that time > 0 given the comment? do you really mean to assert this, or is it an argument check?
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, I want to assert that time>0
|
Test build #73839 has finished for PR 17133 at commit
|
|
Test build #73849 has finished for PR 17133 at commit
|
| gettingResultTime = time | ||
| } | ||
|
|
||
| private[spark] def markFinished(state: TaskState, time: Long = System.currentTimeMillis) { |
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.
How about removing the default value for the argument? I only see one other call site for this method that would need to be changed.
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, good idea.
|
Test build #73881 has finished for PR 17133 at commit
|
|
Merging to master. |
What changes were proposed in this pull request?
TaskSetManager is now using
System.getCurrentTimeMilliswhen mark task as finished inhandleSuccessfulTaskandhandleFailedTask. Thus developer cannot set the tasks finishing time in unit test. WhenhandleSuccessfulTask, task's duration =System.getCurrentTimeMillis- launchTime(which can be set byclock), the result is not correct.How was this patch tested?
Existing tests.