vanzin 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_r332705981
 
 

 ##########
 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:
   Also, just wanted to point out that it's ok if `nanoTime` is not completely 
monotonic, as long as it's better than `getTimeMillis()`. After all, this code 
was working with a non-monotonic clock before.
   
   The only problem is if different threads can have wildly different views of 
what `nanoTime` returns, so that comparing the values makes no sense. I don't 
believe that to be the case.

----------------------------------------------------------------
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