[
https://issues.apache.org/jira/browse/MESOS-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13587332#comment-13587332
]
Benjamin Mahler commented on MESOS-335:
---------------------------------------
The largest integral value x that can be stored in a double, for which x+1
cannot be stored precisely is 2^53 [1].
This means if using doubles to represent the time in nanoseconds, we're no
longer able to do so precisely after 104.25 days since the epoch. Likewise for
microseconds (precision returned by Clock::now), the point at which we start
losing precision is 285.427 years. This means we would be likely be ok if not
for the conversion into nanoseconds and back.
It's hard to see how Duration should be using a double of nanoseconds as the
base value, another solution could be:
3. Continue to use a double in Duration, but use a base unit of seconds.
[1]
http://stackoverflow.com/questions/1848700/biggest-integer-that-can-be-stored-in-a-double
> Statistics.truncate is flaky.
> -----------------------------
>
> Key: MESOS-335
> URL: https://issues.apache.org/jira/browse/MESOS-335
> Project: Mesos
> Issue Type: Bug
> Reporter: Benjamin Mahler
> Assignee: Benjamin Mahler
>
> Looks like a double comparison issue..?
> [ RUN ] Statistics.truncate
> ../../../third_party/libprocess/src/tests/statistics_tests.cpp:58: Failure
> Expected: (Clock::now()) >= (values.get().begin()->first.secs()), actual:
> 1.36184e+09 vs 1.36184e+09
> ../../../third_party/libprocess/src/tests/statistics_tests.cpp:71: Failure
> Expected: (Clock::now()) >= (values.get().begin()->first.secs()), actual:
> 1.36193e+09 vs 1.36193e+09
> [ FAILED ] Statistics.truncate (1 ms)
> Another flaky one:
> [ RUN ] Statistics.archive
> ../../../third_party/libprocess/src/tests/statistics_tests.cpp:175: Failure
> Value of: values.get().empty()
> Actual: false
> Expected: true
> [ FAILED ] Statistics.archive (2 ms)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira