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

Mandeep Chadha commented on MESOS-3552:
---------------------------------------

F0922 15:08:06.158139 306833 resources.cpp:872] Check failed: result.cpus() == 
cpus() && result.mem() == mem() && result.disk() == disk() && result.ports() == 
ports() 

https://github.com/apache/mesos/blob/master/src/common/resources.cpp#L869


Option<double> Resources::cpus() const
{
  Option<Value::Scalar> value = get<Value::Scalar>("cpus");
  if (value.isSome()) {
    return value.get().value();
  } else {
    return None();
  }
}

https://github.com/apache/mesos/blob/master/3rdparty/libprocess/3rdparty/stout/include/stout/option.hpp#L118

  bool operator==(const Option<T>& that) const
  {
    return (isNone() && that.isNone()) ||
      (isSome() && that.isSome() && t == that.t);
  }

t == that.t ---> results in (double == double)   ( operator== for 
Option<double>) 



> Check failed: result.cpus() == cpus() && result.mem() == mem() && 
> result.disk() == disk() && result.ports() == ports() 
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: MESOS-3552
>                 URL: https://issues.apache.org/jira/browse/MESOS-3552
>             Project: Mesos
>          Issue Type: Bug
>          Components: master
>    Affects Versions: 0.24.1
>            Reporter: Mandeep Chadha
>            Assignee: Mandeep Chadha
>
> result.cpus() == cpus() check is failing due to ( double == double ) 
> comparison problem. 
> Root Cause : 
> Framework requested 0.1 cpu reservation for the first task. So far so good. 
> Next Reserve operation — lead to double operations resulting in following 
> double values :
>  results.cpus() : 23.9999999999999964472863211995 cpus() : 24
> And the check ( result.cpus() == cpus() ) failed. 
>  The double arithmetic operations caused results.cpus() value to be :  
> 23.9999999999999964472863211995 and hence ( 23.9999999999999964472863211995 
> == 24 ) failed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to