jbrennan333 commented on a change in pull request #2612:
URL: https://github.com/apache/hadoop/pull/2612#discussion_r645079446
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell/src/main/java/org/apache/hadoop/yarn/applications/distributedshell/Client.java
##########
@@ -1179,7 +1180,7 @@ private boolean monitorApplication(ApplicationId appId)
// The value equal or less than 0 means no timeout
if (clientTimeout > 0
- && System.currentTimeMillis() > (clientStartTime + clientTimeout)) {
+ && Time.monotonicNow() > (clientStartTime + clientTimeout)) {
Review comment:
This can break if clientStartTime + clientTimeout rolls over to a
negative value.
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestAMRMClientOnRMRestart.java
##########
@@ -432,7 +433,7 @@ public void testAMRMClientOnAMRMTokenRollOverOnRMRestart()
throws Exception {
// start first RM
MyResourceManager2 rm1 = new MyResourceManager2(conf, memStore);
rm1.start();
- Long startTime = System.currentTimeMillis();
+ Long startTime = Time.monotonicNow();
Review comment:
Shouldn't this just be a long?
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineV2ClientImpl.java
##########
@@ -471,10 +472,10 @@ public void run() {
// Try to drain the remaining entities to be published @ the max
for
// 2 seconds
long timeTillweDrain =
- System.currentTimeMillis() + drainTimeoutPeriod;
+ Time.monotonicNow() + drainTimeoutPeriod;
while (!timelineEntityQueue.isEmpty()) {
publishWithoutBlockingOnQueue(timelineEntityQueue.poll());
- if (System.currentTimeMillis() > timeTillweDrain) {
+ if (Time.monotonicNow() > timeTillweDrain) {
Review comment:
Could break due to overflow.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]