-
Notifications
You must be signed in to change notification settings - Fork 29k
SPARK-10614 SystemClock uses non-monotonic time in its wait logic. Th… #8766
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-10614 SystemClock uses non-monotonic time in its wait logic. Th… #8766
Conversation
|
Test build #42485 has finished for PR 8766 at commit
|
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: ordering
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.
that's interesting: clearly IntelliJ idea makes ordering decisions within an import line than between them. Fixed to alpha order —and something to look out for in future.
|
Mostly style nits, but there seems to be a real bug in there. Otherwise, looks good. |
…is patch adds a new subclass, MonotonicClock, and switches ExecutorAllocationManager to using it (it used to use System.nanoTime())
a71af05 to
10ea2f3
Compare
|
Test build #42535 has finished for PR 8766 at commit
|
|
test failure is |
|
retest this please |
|
Marcelo, I'm not sure I trust nanoTime any more: I did some reading on the topic and don't think code can be confident it works (i.e. is monotonic and consistent) on multi-socket systems or VMs: http://steveloughran.blogspot.co.uk/2015/09/time-on-multi-core-multi-socket-servers.html if you agree, there's no regression in the code, and we could close this as a WONTFIX. |
|
This is what my That, and some comments on the links that you posted, lead me to believe that I haven't read the code in |
|
Test build #42610 has finished for PR 8766 at commit
|
|
Actually, why introduce another clock here, why not just change |
|
If people are happy with that, I'll do that |
|
Yes let's just do that. There's no point in introducing another system clock and call it something else. Let's just fix the existing one. |
This patch adds a new subclass,
MonotonicClock, and switchesExecutorAllocationManagerto using it (it used to useSystem.nanoTime()).A lot of the code which uses SystemClock would appear to benefit from moving to a monotonic clock —but that would a more significant piece of work, needing understanding of what's happening. Furthermore, some of the uses are of fields which may also be converted to human-formatted time; the nanotime clock shouldn't be used that way.