TestMsgr: Fix forever hang under lossless policy and one is WAIT another down

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
This commit is contained in:
Haomai Wang 2015-08-26 10:36:10 +08:00
parent 128f5a2504
commit 24f4d22d21

View File

@ -983,6 +983,15 @@ class SyntheticWorkload {
ConnectionRef conn = _get_random_connection();
dispatcher.clear_pending(conn);
conn->mark_down();
pair<Messenger*, Messenger*> &p = available_connections[conn];
// it's a lossless policy, so we need to mark down each side
if (!p.first->get_default_policy().server && !p.second->get_default_policy().server) {
ASSERT_EQ(conn->get_messenger(), p.first);
ConnectionRef peer = p.second->get_connection(p.first->get_myinst());
peer->mark_down();
dispatcher.clear_pending(peer);
available_connections.erase(peer);
}
ASSERT_EQ(available_connections.erase(conn), 1U);
}