[ https://issues.apache.org/jira/browse/MESOS-6231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15563066#comment-15563066 ]
Joseph Wu commented on MESOS-6231: ---------------------------------- {code} commit 823b2dfe3a2c262c4811092ab6aeca02823dda5a Author: Neil Conway <neil.con...@gmail.com> Date: Mon Oct 10 10:39:33 2016 -0700 Added TODO describing a common gotcha. Review: https://reviews.apache.org/r/52618/ {code} > Scheduler driver metrics can hang Metrics() in tests > ---------------------------------------------------- > > Key: MESOS-6231 > URL: https://issues.apache.org/jira/browse/MESOS-6231 > Project: Mesos > Issue Type: Bug > Components: tests > Reporter: Neil Conway > Labels: mesosphere > > * {{SchedulerProcess}} has a field, {{metrics}}, whose constructor registers > two metrics, {{event_queue_messages}} and {{event_queue_dispatches}}. > * These metrics are implemented by {{defer}}'ing a message to > {{SchedulerProcess}}. > * If {{MesosSchedulerDriver}} is started and then stopped (but not > destructed), {{SchedulerProcess}} is terminated but not destroyed. > Hence, if a scheduler driver is started and then stopped, fetching the metric > will hang. This means a test case that fetches {{Metrics()}} after stopping a > scheduler driver will hang. > For example, the following patch will hang > {{SlaveTest.MetricsSlaveLaunchErrors}}. > {noformat} > diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp > index 3471314..f323bb9 100644 > --- a/src/tests/slave_tests.cpp > +++ b/src/tests/slave_tests.cpp > @@ -1408,12 +1408,12 @@ TEST_F(SlaveTest, MetricsSlaveLaunchErrors) > AWAIT_READY(failureUpdate); > ASSERT_EQ(TASK_FAILED, failureUpdate.get().state()); > + driver.stop(); > + driver.join(); > + > // After failure injection, metrics should report a single failure. > snapshot = Metrics(); > EXPECT_EQ(1, snapshot.values["slave/container_launch_errors"]); > - > - driver.stop(); > - driver.join(); > } > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)