[ 
https://issues.apache.org/jira/browse/MESOS-7661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16126397#comment-16126397
 ] 

Greg Mann commented on MESOS-7661:
----------------------------------

{code}
commit 1efe264ebcf998c248cb7eecba57bd65e2060645
Author: Gastón Kleiman <[email protected]>
Date:   Mon Aug 14 13:52:50 2017 -0700

    Stout: Made boundary checking in Duration consistent.

    Review: https://reviews.apache.org/r/61601/
{code}
{code}
commit f4348182c1c5b832743166cfdad9b1a84bc2824e
Author: Gastón Kleiman <[email protected]>
Date:   Mon Aug 14 13:52:49 2017 -0700

    Stout: Made `Duration::parse()` handle durations out of range.

    Made `Duration:parse()` return an error if the argument is out of the
    range that a `Duration` can represent.

    Review: https://reviews.apache.org/r/60721/
{code}

> Libprocess timers with long durations trigger immediately
> ---------------------------------------------------------
>
>                 Key: MESOS-7661
>                 URL: https://issues.apache.org/jira/browse/MESOS-7661
>             Project: Mesos
>          Issue Type: Bug
>          Components: libprocess
>            Reporter: Gastón Kleiman
>            Assignee: Gastón Kleiman
>              Labels: mesosphere
>
> {{process::delay()}} will schedule a method to be run right ahead when called 
> with a veeeery long {{Duration}}.
> This happens because [{{Timeout}} tries to add two long 
> durations|https://github.com/apache/mesos/blob/13cae29e7832d8bb879c68847ad0df449d227f17/3rdparty/libprocess/include/process/timeout.hpp#L33-L38],
>  leading to an [integer overflow in 
> {{Duration}}|https://github.com/apache/mesos/blob/13cae29e7832d8bb879c68847ad0df449d227f17/3rdparty/stout/include/stout/duration.hpp#L116].
> I'd expect libprocess to either:
>   1. Never run the method.
>   2. Schedule it in the longest possible {{Duration}}.
> {{Duration::operator+=()}} should probably also handle integer overflows 
> differently. If an addition leads to an integer overflow, it might make more 
> sense to return {{Duration::max()}} than a negative duration.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to