[
https://issues.apache.org/jira/browse/HADOOP-17463?focusedWorklogId=534890&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-534890
]
ASF GitHub Bot logged work on HADOOP-17463:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 12/Jan/21 15:14
Start Date: 12/Jan/21 15:14
Worklog Time Spent: 10m
Work Description: amahussein opened a new pull request #2615:
URL: https://github.com/apache/hadoop/pull/2615
Replace both `System.currentTimeMillis()` and `Time.now()` with
`Time.monotonicNow()` to measure elapsed time.
Code changes are minimal to reduce the size of the patch.
I intentionally left the check style errors in
`hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/ha/ClientBaseWithFixes.java`
because those would require reformatting the entire file, increasing the patch
and confusing the reviewer.
----------------------------------------------------------------
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 534890)
Remaining Estimate: 0h
Time Spent: 10m
> Replace currentTimeMillis with monotonicNow in elapsed time
> -----------------------------------------------------------
>
> Key: HADOOP-17463
> URL: https://issues.apache.org/jira/browse/HADOOP-17463
> Project: Hadoop Common
> Issue Type: Bug
> Reporter: Ahmed Hussein
> Assignee: Ahmed Hussein
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> I noticed that there is a widespread incorrect usage of
> {{System.currentTimeMillis()}} throughout the hadoop code.
> For example:
> {code:java}
> // Some comments here
> long start = System.currentTimeMillis();
> while (System.currentTimeMillis() - start < timeout) {
> // Do something
> }
> {code}
> Elapsed time should be measured using `monotonicNow()`.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]