symious opened a new pull request #3135:
URL: https://github.com/apache/ozone/pull/3135
## What changes were proposed in this pull request?
The current logic to calculate the queue time of a ReplicationTask is as
follows:
```
(Instant.now().getNano() - task.getQueued().getNano()) / 1_000_000;
```
But Instant's nano only records the nanosecond part, it's like operation of
mod.
For example, if nano part of getQueued is 500_000_000, and queue time is
600ms
| item | time|
|---| ---|
|getQueued|500_000_000|
|in Queue|600_000_000|
|getProcessed|1100_000_000|
|call getNano()|100_000_000|
Then the result of the code mentioned above would be (100_000_000 -
500_000_000) / 1_000_000, which is -400.
This ticket is to solve this bug by using Duration.between to get the
correct queueTime.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-6374
## How was this patch tested?
unit test.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]