Re: Review Request 34737: Added test to verify fix for MESOS-2771

2015-05-28 Thread Niklas Nielsen

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

(Updated May 28, 2015, 12:48 p.m.)


Review request for mesos, Ian Downes, Jie Yu, and Vinod Kone.


Changes
---

Addressed Ian's comments


Bugs: MESOS-2771
https://issues.apache.org/jira/browse/MESOS-2771


Repository: mesos


Description
---

Added test to verify fix for MESOS-2771


Diffs (updated)
-

  src/tests/mesos.hpp b8f7a2f9236166e42421d926718af8d45e857eba 
  src/tests/monitor_tests.cpp ca3b7f4a85824697a4e6701285f69ba337506147 

Diff: https://reviews.apache.org/r/34737/diff/


Testing
---

Test verifies fix for MESOS-2771, where references to executor infos and 
container ids could get invalidated if monitoring of a container stopped during 
a statistics collection.

Tested with make check before and after fix.

Before:

I0527 15:51:57.943672 388640768 process.cpp:2201] Cleaning up 
__http__(1)@10.0.68.255:50624
I0527 15:51:57.943717 387567616 process.cpp:2094] Resuming 
__gc__@10.0.68.255:50624 at 2015-05-27 22:51:57.943728896+00:00
PC: @0x11122bb3d std::__1::operator<< <>()
*** SIGSEGV (@0x0) received by PID 42293 (TID 0x7fff7cdb2300) stack trace: ***
@ 0x7fff8eaebf1a _sigtramp
@ 0x7fd785800ee8 (unknown)
@0x1112e97d0 mesos::operator<<()
@0x111b41731 
mesos::internal::slave::ResourceMonitorProcess::usage()::$_0::operator()()
@0x111b415ed 
_ZZNK7process6FutureIN5mesos8internal5slave15ResourceMonitor5UsageEE8onFailedIZNS3_22ResourceMonitorProcess5usageENS1_11ContainerIDEE3$_0vEERKS6_OT_NS6_6PreferEENUlRKNSt3__112basic_stringIcNSG_11char_traitsIcEENSG_9allocatorIcE_clESO_
@0x111b4152c 
_ZNSt3__110__function6__funcIZNK7process6FutureIN5mesos8internal5slave15ResourceMonitor5UsageEE8onFailedIZNS6_22ResourceMonitorProcess5usageENS4_11ContainerIDEE3$_0vEERKS9_OT_NS9_6PreferEEUlRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcE_NSM_ISR_EEFvSQ_EEclESQ_
@0x112106544 std::__1::function<>::operator()()
@0x1112067ab 
_ZN7process8internal3runINSt3__18functionIFvRKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEJRS9_EEEvRKNS2_6vectorIT_NS7_ISG_DpOT0_
@0x111b86400 process::Future<>::fail()
@0x111ba05bd process::Promise<>::fail()
@0x111b9722c process::internal::thenf<>()
@0x111b9f823 
_ZNSt3__110__function6__funcINS_6__bindIPFvRKNS_8functionIFN7process6FutureIN5mesos8internal5slave15ResourceMonitor5UsageEEERKNS6_18ResourceStatisticsRKNS_10shared_ptrINS4_7PromiseISA_RKNS5_ISC_EEEJSI_RSM_RNS_12placeholders4__phILi1EENS_9allocatorISZ_EEFvSR_EEclESR_
@0x1121db254 std::__1::function<>::operator()()
@0x111b9c90d 
_ZZNK7process6FutureIN5mesos18ResourceStatisticsEE5onAnyIRNSt3__18functionIFvRKS3_EEEvEES8_OT_NS3_6PreferEENUlS8_E_clES8_
@0x111b9c84c 
_ZNSt3__110__function6__funcIZNK7process6FutureIN5mesos18ResourceStatisticsEE5onAnyIRNS_8functionIFvRKS6_EEEvEESA_OT_NS6_6PreferEEUlSA_E_NS_9allocatorISH_EESB_EclESA_
@0x10e73b0d4 std::__1::function<>::operator()()
@0x10e73a50b 
_ZN7process8internal3runINSt3__18functionIFvRKNS_6FutureIN5mesos18ResourceStatisticsEEJRS7_EEEvRKNS2_6vectorIT_NS2_9allocatorISE_DpOT0_
@0x10efd83c1 process::Future<>::fail()
@0x10efdd49d 
_ZZNK7process6FutureIN5mesos18ResourceStatisticsEE8onFailedINSt3__16__bindIMS3_FbRKNS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEJRS3_RNS5_12placeholders4__phILi1EEbEERKS3_OT_NS3_6PreferEENUlSE_E_clESE_
@0x10efdd1fc 
_ZNSt3__110__function6__funcIZNK7process6FutureIN5mesos18ResourceStatisticsEE8onFailedINS_6__bindIMS6_FbRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEJRS6_RNS_12placeholders4__phILi1EEbEERKS6_OT_NS6_6PreferEEUlSG_E_NSC_ISU_EEFvSG_EEclESG_
@0x10e5b2304 std::__1::function<>::operator()()
@0x10efdb9f9 process::Future<>::onFailed()
@0x10efdb6c8 
_ZNK7process6FutureIN5mesos18ResourceStatisticsEE8onFailedINSt3__16__bindIMS3_FbRKNS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEJRS3_RNS5_12placeholders4__phILi1EEbEERKS3_OT_NS3_6PreferE
@0x10efd9145 
_ZNK7process6FutureIN5mesos18ResourceStatisticsEE8onFailedINSt3__16__bindIMS3_FbRKNS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEJRS3_RNS5_12placeholders4__phILi1RKS3_OT_
@0x10efd8b43 process::Promise<>::associate()
@0x10efd81bd process::Promise<>::set()
@0x10efd684e 
mesos::internal::tests::MonitorTest_UsageFailure_Test::TestBody()
@0x10f4155b3 
testing::internal::HandleSehExceptionsInMethodIfSupported<>()
@0x10f3fd667 
testing::internal::HandleExceptionsInMethodIfSupported<>()
@0x10f3d7135 testin

Re: Review Request 34737: Added test to verify fix for MESOS-2771

2015-05-28 Thread Ian Downes

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

Ship it!


Looks good. Main issue is that this can and should be a generally useful test 
not one to verify we don't segfault after the fix. Please reword comments and 
add expectations for response output. Other comments are stylistic and most are 
copied from the other monitor test.


src/tests/monitor_tests.cpp


I'd state this more generally as a test for correct handling of the 
statistics.json endpoint when monitoring of a container is stopped, i.e., the 
test is useful independently of the bug revealed in MESOS-2771.



src/tests/monitor_tests.cpp


s/Setup/Set up/



src/tests/monitor_tests.cpp


No yours but add a macro to tests/mesos.hpp?



src/tests/monitor_tests.cpp


Can you use the DEFAULT_EXECUTOR_ID macro from tests/mesos.hpp?



src/tests/monitor_tests.cpp


DEFAULT_EXECUTOR_INFO?



src/tests/monitor_tests.cpp


s/setup/set up/



src/tests/monitor_tests.cpp


Again, not yours but

Single line?

AWAIT_READY(monitor.start())?



src/tests/monitor_tests.cpp


s/Cause/Induce a/



src/tests/monitor_tests.cpp


"Stop monitoring the container"?



src/tests/monitor_tests.cpp


AWAIT_READY()?



src/tests/monitor_tests.cpp


Reword this comment to make it general and not specific to the bug in 
MESOS-2771.



src/tests/monitor_tests.cpp


To make this test general, please check the expected output in response, 
i.e., the container will *not* be included.


- Ian Downes


On May 27, 2015, 4:14 p.m., Niklas Nielsen wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/34737/
> ---
> 
> (Updated May 27, 2015, 4:14 p.m.)
> 
> 
> Review request for mesos, Ian Downes, Jie Yu, and Vinod Kone.
> 
> 
> Bugs: MESOS-2771
> https://issues.apache.org/jira/browse/MESOS-2771
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Added test to verify fix for MESOS-2771
> 
> 
> Diffs
> -
> 
>   src/tests/monitor_tests.cpp ca3b7f4a85824697a4e6701285f69ba337506147 
> 
> Diff: https://reviews.apache.org/r/34737/diff/
> 
> 
> Testing
> ---
> 
> Test verifies fix for MESOS-2771, where references to executor infos and 
> container ids could get invalidated if monitoring of a container stopped 
> during a statistics collection.
> 
> Tested with make check before and after fix.
> 
> Before:
> 
> I0527 15:51:57.943672 388640768 process.cpp:2201] Cleaning up 
> __http__(1)@10.0.68.255:50624
> I0527 15:51:57.943717 387567616 process.cpp:2094] Resuming 
> __gc__@10.0.68.255:50624 at 2015-05-27 22:51:57.943728896+00:00
> PC: @0x11122bb3d std::__1::operator<< <>()
> *** SIGSEGV (@0x0) received by PID 42293 (TID 0x7fff7cdb2300) stack trace: ***
> @ 0x7fff8eaebf1a _sigtramp
> @ 0x7fd785800ee8 (unknown)
> @0x1112e97d0 mesos::operator<<()
> @0x111b41731 
> mesos::internal::slave::ResourceMonitorProcess::usage()::$_0::operator()()
> @0x111b415ed 
> _ZZNK7process6FutureIN5mesos8internal5slave15ResourceMonitor5UsageEE8onFailedIZNS3_22ResourceMonitorProcess5usageENS1_11ContainerIDEE3$_0vEERKS6_OT_NS6_6PreferEENUlRKNSt3__112basic_stringIcNSG_11char_traitsIcEENSG_9allocatorIcE_clESO_
> @0x111b4152c 
> _ZNSt3__110__function6__funcIZNK7process6FutureIN5mesos8internal5slave15ResourceMonitor5UsageEE8onFailedIZNS6_22ResourceMonitorProcess5usageENS4_11ContainerIDEE3$_0vEERKS9_OT_NS9_6PreferEEUlRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcE_NSM_ISR_EEFvSQ_EEclESQ_
> @0x112106544 std::__1::function<>::operator()()
> @0x1112067ab 
> _ZN7process8internal3runINSt3__18functionIFvRKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEJRS9_EEEvRKNS2_6vectorIT_NS7_ISG_DpOT0_
> @0x111b86400 process::Future<>::fail()
> @0x111ba05bd process::Promise<>::fail()
> @0x111b9722c process::internal::thenf<>()
> @0x111b9f823 
> _ZNSt3__110__function6__funcINS_6__bindIPFvRKNS_8functionIFN7process6FutureIN5mesos8inte

Re: Review Request 34737: Added test to verify fix for MESOS-2771

2015-05-27 Thread Mesos ReviewBot

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


Patch looks great!

Reviews applied: [34737]

All tests passed.

- Mesos ReviewBot


On May 27, 2015, 11:14 p.m., Niklas Nielsen wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/34737/
> ---
> 
> (Updated May 27, 2015, 11:14 p.m.)
> 
> 
> Review request for mesos, Ian Downes, Jie Yu, and Vinod Kone.
> 
> 
> Bugs: MESOS-2771
> https://issues.apache.org/jira/browse/MESOS-2771
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Added test to verify fix for MESOS-2771
> 
> 
> Diffs
> -
> 
>   src/tests/monitor_tests.cpp ca3b7f4a85824697a4e6701285f69ba337506147 
> 
> Diff: https://reviews.apache.org/r/34737/diff/
> 
> 
> Testing
> ---
> 
> Test verifies fix for MESOS-2771, where references to executor infos and 
> container ids could get invalidated if monitoring of a container stopped 
> during a statistics collection.
> 
> Tested with make check before and after fix.
> 
> Before:
> 
> I0527 15:51:57.943672 388640768 process.cpp:2201] Cleaning up 
> __http__(1)@10.0.68.255:50624
> I0527 15:51:57.943717 387567616 process.cpp:2094] Resuming 
> __gc__@10.0.68.255:50624 at 2015-05-27 22:51:57.943728896+00:00
> PC: @0x11122bb3d std::__1::operator<< <>()
> *** SIGSEGV (@0x0) received by PID 42293 (TID 0x7fff7cdb2300) stack trace: ***
> @ 0x7fff8eaebf1a _sigtramp
> @ 0x7fd785800ee8 (unknown)
> @0x1112e97d0 mesos::operator<<()
> @0x111b41731 
> mesos::internal::slave::ResourceMonitorProcess::usage()::$_0::operator()()
> @0x111b415ed 
> _ZZNK7process6FutureIN5mesos8internal5slave15ResourceMonitor5UsageEE8onFailedIZNS3_22ResourceMonitorProcess5usageENS1_11ContainerIDEE3$_0vEERKS6_OT_NS6_6PreferEENUlRKNSt3__112basic_stringIcNSG_11char_traitsIcEENSG_9allocatorIcE_clESO_
> @0x111b4152c 
> _ZNSt3__110__function6__funcIZNK7process6FutureIN5mesos8internal5slave15ResourceMonitor5UsageEE8onFailedIZNS6_22ResourceMonitorProcess5usageENS4_11ContainerIDEE3$_0vEERKS9_OT_NS9_6PreferEEUlRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcE_NSM_ISR_EEFvSQ_EEclESQ_
> @0x112106544 std::__1::function<>::operator()()
> @0x1112067ab 
> _ZN7process8internal3runINSt3__18functionIFvRKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEJRS9_EEEvRKNS2_6vectorIT_NS7_ISG_DpOT0_
> @0x111b86400 process::Future<>::fail()
> @0x111ba05bd process::Promise<>::fail()
> @0x111b9722c process::internal::thenf<>()
> @0x111b9f823 
> _ZNSt3__110__function6__funcINS_6__bindIPFvRKNS_8functionIFN7process6FutureIN5mesos8internal5slave15ResourceMonitor5UsageEEERKNS6_18ResourceStatisticsRKNS_10shared_ptrINS4_7PromiseISA_RKNS5_ISC_EEEJSI_RSM_RNS_12placeholders4__phILi1EENS_9allocatorISZ_EEFvSR_EEclESR_
> @0x1121db254 std::__1::function<>::operator()()
> @0x111b9c90d 
> _ZZNK7process6FutureIN5mesos18ResourceStatisticsEE5onAnyIRNSt3__18functionIFvRKS3_EEEvEES8_OT_NS3_6PreferEENUlS8_E_clES8_
> @0x111b9c84c 
> _ZNSt3__110__function6__funcIZNK7process6FutureIN5mesos18ResourceStatisticsEE5onAnyIRNS_8functionIFvRKS6_EEEvEESA_OT_NS6_6PreferEEUlSA_E_NS_9allocatorISH_EESB_EclESA_
> @0x10e73b0d4 std::__1::function<>::operator()()
> @0x10e73a50b 
> _ZN7process8internal3runINSt3__18functionIFvRKNS_6FutureIN5mesos18ResourceStatisticsEEJRS7_EEEvRKNS2_6vectorIT_NS2_9allocatorISE_DpOT0_
> @0x10efd83c1 process::Future<>::fail()
> @0x10efdd49d 
> _ZZNK7process6FutureIN5mesos18ResourceStatisticsEE8onFailedINSt3__16__bindIMS3_FbRKNS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEJRS3_RNS5_12placeholders4__phILi1EEbEERKS3_OT_NS3_6PreferEENUlSE_E_clESE_
> @0x10efdd1fc 
> _ZNSt3__110__function6__funcIZNK7process6FutureIN5mesos18ResourceStatisticsEE8onFailedINS_6__bindIMS6_FbRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEJRS6_RNS_12placeholders4__phILi1EEbEERKS6_OT_NS6_6PreferEEUlSG_E_NSC_ISU_EEFvSG_EEclESG_
> @0x10e5b2304 std::__1::function<>::operator()()
> @0x10efdb9f9 process::Future<>::onFailed()
> @0x10efdb6c8 
> _ZNK7process6FutureIN5mesos18ResourceStatisticsEE8onFailedINSt3__16__bindIMS3_FbRKNS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEJRS3_RNS5_12placeholders4__phILi1EEbEERKS3_OT_NS3_6PreferE
> @0x10efd9145 
> _ZNK7process6FutureIN5mesos18ResourceStatisticsEE8onFailedINSt3__16__bindIMS3_FbRKNS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEJRS3_RNS5_12placeholders4__phILi1

Re: Review Request 34737: Added test to verify fix for MESOS-2771

2015-05-27 Thread Niklas Nielsen

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

(Updated May 27, 2015, 4:14 p.m.)


Review request for mesos, Ian Downes, Jie Yu, and Vinod Kone.


Bugs: MESOS-2771
https://issues.apache.org/jira/browse/MESOS-2771


Repository: mesos


Description
---

Added test to verify fix for MESOS-2771


Diffs
-

  src/tests/monitor_tests.cpp ca3b7f4a85824697a4e6701285f69ba337506147 

Diff: https://reviews.apache.org/r/34737/diff/


Testing
---

Test verifies fix for MESOS-2771, where references to executor infos and 
container ids could get invalidated if monitoring of a container stopped during 
a statistics collection.

Tested with make check before and after fix.

Before:

I0527 15:51:57.943672 388640768 process.cpp:2201] Cleaning up 
__http__(1)@10.0.68.255:50624
I0527 15:51:57.943717 387567616 process.cpp:2094] Resuming 
__gc__@10.0.68.255:50624 at 2015-05-27 22:51:57.943728896+00:00
PC: @0x11122bb3d std::__1::operator<< <>()
*** SIGSEGV (@0x0) received by PID 42293 (TID 0x7fff7cdb2300) stack trace: ***
@ 0x7fff8eaebf1a _sigtramp
@ 0x7fd785800ee8 (unknown)
@0x1112e97d0 mesos::operator<<()
@0x111b41731 
mesos::internal::slave::ResourceMonitorProcess::usage()::$_0::operator()()
@0x111b415ed 
_ZZNK7process6FutureIN5mesos8internal5slave15ResourceMonitor5UsageEE8onFailedIZNS3_22ResourceMonitorProcess5usageENS1_11ContainerIDEE3$_0vEERKS6_OT_NS6_6PreferEENUlRKNSt3__112basic_stringIcNSG_11char_traitsIcEENSG_9allocatorIcE_clESO_
@0x111b4152c 
_ZNSt3__110__function6__funcIZNK7process6FutureIN5mesos8internal5slave15ResourceMonitor5UsageEE8onFailedIZNS6_22ResourceMonitorProcess5usageENS4_11ContainerIDEE3$_0vEERKS9_OT_NS9_6PreferEEUlRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcE_NSM_ISR_EEFvSQ_EEclESQ_
@0x112106544 std::__1::function<>::operator()()
@0x1112067ab 
_ZN7process8internal3runINSt3__18functionIFvRKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEJRS9_EEEvRKNS2_6vectorIT_NS7_ISG_DpOT0_
@0x111b86400 process::Future<>::fail()
@0x111ba05bd process::Promise<>::fail()
@0x111b9722c process::internal::thenf<>()
@0x111b9f823 
_ZNSt3__110__function6__funcINS_6__bindIPFvRKNS_8functionIFN7process6FutureIN5mesos8internal5slave15ResourceMonitor5UsageEEERKNS6_18ResourceStatisticsRKNS_10shared_ptrINS4_7PromiseISA_RKNS5_ISC_EEEJSI_RSM_RNS_12placeholders4__phILi1EENS_9allocatorISZ_EEFvSR_EEclESR_
@0x1121db254 std::__1::function<>::operator()()
@0x111b9c90d 
_ZZNK7process6FutureIN5mesos18ResourceStatisticsEE5onAnyIRNSt3__18functionIFvRKS3_EEEvEES8_OT_NS3_6PreferEENUlS8_E_clES8_
@0x111b9c84c 
_ZNSt3__110__function6__funcIZNK7process6FutureIN5mesos18ResourceStatisticsEE5onAnyIRNS_8functionIFvRKS6_EEEvEESA_OT_NS6_6PreferEEUlSA_E_NS_9allocatorISH_EESB_EclESA_
@0x10e73b0d4 std::__1::function<>::operator()()
@0x10e73a50b 
_ZN7process8internal3runINSt3__18functionIFvRKNS_6FutureIN5mesos18ResourceStatisticsEEJRS7_EEEvRKNS2_6vectorIT_NS2_9allocatorISE_DpOT0_
@0x10efd83c1 process::Future<>::fail()
@0x10efdd49d 
_ZZNK7process6FutureIN5mesos18ResourceStatisticsEE8onFailedINSt3__16__bindIMS3_FbRKNS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEJRS3_RNS5_12placeholders4__phILi1EEbEERKS3_OT_NS3_6PreferEENUlSE_E_clESE_
@0x10efdd1fc 
_ZNSt3__110__function6__funcIZNK7process6FutureIN5mesos18ResourceStatisticsEE8onFailedINS_6__bindIMS6_FbRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEJRS6_RNS_12placeholders4__phILi1EEbEERKS6_OT_NS6_6PreferEEUlSG_E_NSC_ISU_EEFvSG_EEclESG_
@0x10e5b2304 std::__1::function<>::operator()()
@0x10efdb9f9 process::Future<>::onFailed()
@0x10efdb6c8 
_ZNK7process6FutureIN5mesos18ResourceStatisticsEE8onFailedINSt3__16__bindIMS3_FbRKNS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEJRS3_RNS5_12placeholders4__phILi1EEbEERKS3_OT_NS3_6PreferE
@0x10efd9145 
_ZNK7process6FutureIN5mesos18ResourceStatisticsEE8onFailedINSt3__16__bindIMS3_FbRKNS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEJRS3_RNS5_12placeholders4__phILi1RKS3_OT_
@0x10efd8b43 process::Promise<>::associate()
@0x10efd81bd process::Promise<>::set()
@0x10efd684e 
mesos::internal::tests::MonitorTest_UsageFailure_Test::TestBody()
@0x10f4155b3 
testing::internal::HandleSehExceptionsInMethodIfSupported<>()
@0x10f3fd667 
testing::internal::HandleExceptionsInMethodIfSupported<>()
@0x10f3d7135 testing::Test::Run()
@0x10f3d80eb testing::TestInfo::Run()
@0x10f3d8cd7 testing::TestCase::Run()
^C^C

Review Request 34737: Added test to verify fix for MESOS-2771

2015-05-27 Thread Niklas Nielsen

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

Review request for mesos, Ian Downes, Jie Yu, and Vinod Kone.


Repository: mesos


Description
---

Added test to verify fix for MESOS-2771


Diffs
-

  src/tests/monitor_tests.cpp ca3b7f4a85824697a4e6701285f69ba337506147 

Diff: https://reviews.apache.org/r/34737/diff/


Testing
---

Test verifies fix for MESOS-2771, where references to executor infos and 
container ids could get invalidated if monitoring of a container stopped during 
a statistics collection.

Tested with make check before and after fix.

Before:

I0527 15:51:57.943672 388640768 process.cpp:2201] Cleaning up 
__http__(1)@10.0.68.255:50624
I0527 15:51:57.943717 387567616 process.cpp:2094] Resuming 
__gc__@10.0.68.255:50624 at 2015-05-27 22:51:57.943728896+00:00
PC: @0x11122bb3d std::__1::operator<< <>()
*** SIGSEGV (@0x0) received by PID 42293 (TID 0x7fff7cdb2300) stack trace: ***
@ 0x7fff8eaebf1a _sigtramp
@ 0x7fd785800ee8 (unknown)
@0x1112e97d0 mesos::operator<<()
@0x111b41731 
mesos::internal::slave::ResourceMonitorProcess::usage()::$_0::operator()()
@0x111b415ed 
_ZZNK7process6FutureIN5mesos8internal5slave15ResourceMonitor5UsageEE8onFailedIZNS3_22ResourceMonitorProcess5usageENS1_11ContainerIDEE3$_0vEERKS6_OT_NS6_6PreferEENUlRKNSt3__112basic_stringIcNSG_11char_traitsIcEENSG_9allocatorIcE_clESO_
@0x111b4152c 
_ZNSt3__110__function6__funcIZNK7process6FutureIN5mesos8internal5slave15ResourceMonitor5UsageEE8onFailedIZNS6_22ResourceMonitorProcess5usageENS4_11ContainerIDEE3$_0vEERKS9_OT_NS9_6PreferEEUlRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcE_NSM_ISR_EEFvSQ_EEclESQ_
@0x112106544 std::__1::function<>::operator()()
@0x1112067ab 
_ZN7process8internal3runINSt3__18functionIFvRKNS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEJRS9_EEEvRKNS2_6vectorIT_NS7_ISG_DpOT0_
@0x111b86400 process::Future<>::fail()
@0x111ba05bd process::Promise<>::fail()
@0x111b9722c process::internal::thenf<>()
@0x111b9f823 
_ZNSt3__110__function6__funcINS_6__bindIPFvRKNS_8functionIFN7process6FutureIN5mesos8internal5slave15ResourceMonitor5UsageEEERKNS6_18ResourceStatisticsRKNS_10shared_ptrINS4_7PromiseISA_RKNS5_ISC_EEEJSI_RSM_RNS_12placeholders4__phILi1EENS_9allocatorISZ_EEFvSR_EEclESR_
@0x1121db254 std::__1::function<>::operator()()
@0x111b9c90d 
_ZZNK7process6FutureIN5mesos18ResourceStatisticsEE5onAnyIRNSt3__18functionIFvRKS3_EEEvEES8_OT_NS3_6PreferEENUlS8_E_clES8_
@0x111b9c84c 
_ZNSt3__110__function6__funcIZNK7process6FutureIN5mesos18ResourceStatisticsEE5onAnyIRNS_8functionIFvRKS6_EEEvEESA_OT_NS6_6PreferEEUlSA_E_NS_9allocatorISH_EESB_EclESA_
@0x10e73b0d4 std::__1::function<>::operator()()
@0x10e73a50b 
_ZN7process8internal3runINSt3__18functionIFvRKNS_6FutureIN5mesos18ResourceStatisticsEEJRS7_EEEvRKNS2_6vectorIT_NS2_9allocatorISE_DpOT0_
@0x10efd83c1 process::Future<>::fail()
@0x10efdd49d 
_ZZNK7process6FutureIN5mesos18ResourceStatisticsEE8onFailedINSt3__16__bindIMS3_FbRKNS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEJRS3_RNS5_12placeholders4__phILi1EEbEERKS3_OT_NS3_6PreferEENUlSE_E_clESE_
@0x10efdd1fc 
_ZNSt3__110__function6__funcIZNK7process6FutureIN5mesos18ResourceStatisticsEE8onFailedINS_6__bindIMS6_FbRKNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEJRS6_RNS_12placeholders4__phILi1EEbEERKS6_OT_NS6_6PreferEEUlSG_E_NSC_ISU_EEFvSG_EEclESG_
@0x10e5b2304 std::__1::function<>::operator()()
@0x10efdb9f9 process::Future<>::onFailed()
@0x10efdb6c8 
_ZNK7process6FutureIN5mesos18ResourceStatisticsEE8onFailedINSt3__16__bindIMS3_FbRKNS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEJRS3_RNS5_12placeholders4__phILi1EEbEERKS3_OT_NS3_6PreferE
@0x10efd9145 
_ZNK7process6FutureIN5mesos18ResourceStatisticsEE8onFailedINSt3__16__bindIMS3_FbRKNS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEJRS3_RNS5_12placeholders4__phILi1RKS3_OT_
@0x10efd8b43 process::Promise<>::associate()
@0x10efd81bd process::Promise<>::set()
@0x10efd684e 
mesos::internal::tests::MonitorTest_UsageFailure_Test::TestBody()
@0x10f4155b3 
testing::internal::HandleSehExceptionsInMethodIfSupported<>()
@0x10f3fd667 
testing::internal::HandleExceptionsInMethodIfSupported<>()
@0x10f3d7135 testing::Test::Run()
@0x10f3d80eb testing::TestInfo::Run()
@0x10f3d8cd7 testing::TestCase::Run()
^C^C
[1]42293 segmentation fault  GLOG_v=2 ./bin/mesos-tests.sh 
--gtest_filter="MonitorTest.UsageFailure"