MaxGekk commented on a change in pull request #26058: [SPARK-10614][core] Add 
monotonic time to Clock interface.
URL: https://github.com/apache/spark/pull/26058#discussion_r332707004
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala
 ##########
 @@ -288,7 +288,7 @@ private[spark] class ExecutorAllocationManager(
     }
 
     // Update executor target number only after initializing flag is unset
-    updateAndSyncNumExecutorsTarget(clock.getTimeMillis())
+    updateAndSyncNumExecutorsTarget(clock.nanoTime())
 
 Review comment:
   `System.nanoTime()` can use `clock_gettime(CLOCK_MONOTONIC, ...)` on Linux: 
http://hg.openjdk.java.net/jdk8/jdk8/hotspot/file/tip/src/os/linux/vm/os_linux.cpp#l1453
   `CLOCK_MONOTONIC` is based on the Time Stamp Counter 
(https://en.wikipedia.org/wiki/Time_Stamp_Counter). Its synchronization across 
CPU cores depends on CPU architecture, for example: _"AMD processors up to the 
K8 core always incremented the time-stamp counter every clock cycle.[6] Thus, 
power management features were able to change the number of increments per 
second, and the values could get out of sync between different cores or 
processors in the same system."_

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to