> On Nov. 26, 2015, 3:14 p.m., Neil Conway wrote:
> > src/common/resources.cpp, line 951
> > <https://reviews.apache.org/r/40730/diff/1/?file=1147236#file1147236line951>
> >
> >     This definitely needs an explanatory comment.
> 
> Bernd Mathiske wrote:
>     I'll propose a patch that addresses these issues.

What if results or cpus returns isNone or one of them is isNone ( Option ) , 
then get() is going to crash. CHECK_NEAR() does the same thing as the previous 
review request and this is the history of previous review request :


"CHECK_DOUBLE_EQ will also fail. 

F0930 18:15:38.169140 26984 resources.cpp:874] Check failed: 
(result.cpus().get()) >= (cpus().get())-0.000000000000001L (24 vs. 24)  Check 
failure stack trace:  F0930 18:15:38.169322 26991 resources.cpp:874] Check 
failed: (result.cpus().get()) >= (cpus().get())-0.000000000000001L (24 vs. 24)  
Check failure stack trace:

CHECK_NEAR() is the right Macro to use. 


But we also need to check (isNone() and isNone()) equality and hence the 
present implementation. I think the long term fix is to wrap double into Double 
and have the opeartor== to the right thing.

" 

Using CHECK_NEAR() is fine but not checking other state of Option<> may lead to 
crash and is not complete.


- Mandeep


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40730/#review108140
-----------------------------------------------------------


On Nov. 26, 2015, 6:52 a.m., Avinash sridharan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40730/
> -----------------------------------------------------------
> 
> (Updated Nov. 26, 2015, 6:52 a.m.)
> 
> 
> Review request for mesos, Bernd Mathiske, Klaus Ma, and Neil Conway.
> 
> 
> Bugs: MESOS-3552
>     https://issues.apache.org/jira/browse/MESOS-3552
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> A version of this fix was already proposed by Mandeep Chadha (@mchadha) and 
> submitted to the reivew board https://reviews.apache.org/r/39056/ . So the 
> main credit should go to him for this fix.
> 
> 
> Diffs
> -----
> 
>   src/common/resources.cpp b4abf5405039d7d0a5028ccf034ad2e9623d064c 
> 
> Diff: https://reviews.apache.org/r/40730/diff/
> 
> 
> Testing
> -------
> 
> Added Mandeep's test case to GTEST https://reviews.apache.org/r/39056/ and 
> enabled an existing precision test (https://reviews.apache.org/r/40732/) to 
> test this fix.
> 
> 
> Thanks,
> 
> Avinash sridharan
> 
>

Reply via email to