auto conn = msgr->connect(peer_addr, entity_name_t::TYPE_OSD);
return seastar::futurize_invoke([this, conn] {
return do_dispatch_pingpong(conn.get());
- }).finally([this, conn, start_time] {
+ }).then([this, conn, start_time] {
auto session = find_session(conn.get());
std::chrono::duration<double> dur_handshake = session->connected_time - start_time;
std::chrono::duration<double> dur_pingpong = session->finish_time - session->connected_time;
// shutdown
}).then_unpack([] {
return seastar::now();
- }).finally([client1] {
+ }).then([client1] {
logger().info("client1 shutdown...");
return client1->shutdown();
- }).finally([client2] {
+ }).then([client2] {
logger().info("client2 shutdown...");
return client2->shutdown();
- }).finally([server1] {
+ }).then([server1] {
logger().info("server1 shutdown...");
return server1->shutdown();
- }).finally([server2] {
+ }).then([server2] {
logger().info("server2 shutdown...");
return server2->shutdown();
- }).finally([server1, server2, client1, client2] {
+ }).then([server1, server2, client1, client2] {
logger().info("test_echo() done!\n");
});
}
});
}).then([server] {
return server->wait();
- }).finally([client] {
+ }).then([client] {
logger().info("client shutdown...");
client->msgr->stop();
return client->msgr->shutdown();
- }).finally([server] {
+ }).then([server] {
logger().info("server shutdown...");
server->msgr->stop();
return server->msgr->shutdown();
- }).finally([server, client] {
+ }).then([server, client] {
logger().info("test_concurrent_dispatch() done!\n");
});
}
}).then([client] {
logger().info("client shutdown...");
return client->shutdown();
- }).finally([server] {
+ }).then([server] {
logger().info("server shutdown...");
return server->shutdown();
- }).finally([server, client] {
+ }).then([server, client] {
logger().info("test_preemptive_shutdown() done!\n");
});
}
m->cmd.emplace_back(1, static_cast<char>(cmd_t::shutdown));
return cmd_conn->send(m).then([] {
return seastar::sleep(200ms);
- }).finally([this] {
+ }).then([this] {
cmd_msgr->stop();
return cmd_msgr->shutdown();
});
logger().info("\n[FAIL: {}]", eptr);
test_suite->dump_results();
throw;
- }).finally([this] {
+ }).then([this] {
return stop_peer();
- }).finally([this] {
+ }).then([this] {
return test_suite->shutdown().then([this] {
test_suite.reset();
});
return FailoverTestPeer::create(test_peer_addr
).then([test_addr, test_peer_addr] (auto peer) {
return test_v2_protocol(test_addr, test_peer_addr, false
- ).finally([peer = std::move(peer)] () mutable {
+ ).then([peer = std::move(peer)] () mutable {
return peer->wait().then([peer = std::move(peer)] {});
});
}).handle_exception([] (auto eptr) {
return test_v2_lossless_peer_connector(*test);
}).then([test] {
return test_v2_lossless_peer_acceptor(*test);
- }).finally([test] {
+ }).then([test] {
return test->shutdown().then([test] {});
});
}).handle_exception([] (auto eptr) {
return seastar::sleep(50ms);
}).then([] {
logger.info("test_accept() ok\n");
- }).finally([pss] {
+ }).then([pss] {
return pss->destroy();
}).handle_exception([] (auto eptr) {
logger.error("test_accept() got unexpeted exception {}", eptr);
return seastar::now();
}).then([psf] {
return psf->server_connected.get_future();
- }).finally([psf] {
+ }).then([psf] {
if (psf->pss) {
return seastar::smp::submit_to(1u, [psf] {
return psf->pss->destroy();
return seastar::when_all_succeed(
seastar::smp::submit_to(0u, [socket = psf->client_socket.get(),
cb_client = std::move(cb_client)] {
- return cb_client(socket).finally([socket] {
+ return cb_client(socket).then([socket] {
logger.debug("closing client socket...");
return socket->close();
}).handle_exception([] (auto eptr) {
}),
seastar::smp::submit_to(1u, [socket = psf->server_socket.get(),
cb_server = std::move(cb_server)] {
- return cb_server(socket).finally([socket] {
+ return cb_server(socket).then([socket] {
logger.debug("closing server socket...");
return socket->close();
}).handle_exception([] (auto eptr) {
auto sharded_obj = seastar::make_lw_shared<seastar::sharded<T>>();
return sharded_obj->start(args...).then([sharded_obj]() {
seastar::engine().at_exit([sharded_obj]() {
- return sharded_obj->stop().finally([sharded_obj] {});
+ return sharded_obj->stop().then([sharded_obj] {});
});
return sharded_obj.get();
});
}
).handle_exception_type([] (const DepthBroken& e) {
// ok, stopped by stop_dispatch_messages()
- }).finally([this, conn] {
+ }).then([this, conn] {
std::chrono::duration<double> dur_conn = conn_stats.connected_time - conn_stats.connecting_time;
std::chrono::duration<double> dur_msg = mono_clock::now() - conn_stats.start_time;
unsigned ops = conn_stats.received_count - conn_stats.start_count;
}).then([client, ramptime = client_conf.ramptime,
msgtime = client_conf.msgtime] {
return client->dispatch_with_timer(ramptime, msgtime);
- }).finally([client] {
+ }).then([client] {
return client->shutdown();
- }).finally([server, fp_server = std::move(fp_server)] () mutable {
+ }).then([server, fp_server = std::move(fp_server)] () mutable {
return server->shutdown().then([cleanup = std::move(fp_server)] {});
});
} else if (mode == perf_mode_t::client) {
}).then([client, ramptime = client_conf.ramptime,
msgtime = client_conf.msgtime] {
return client->dispatch_with_timer(ramptime, msgtime);
- }).finally([client] {
+ }).then([client] {
return client->shutdown();
});
} else { // mode == perf_mode_t::server
).then([server] {
return server->wait();
// shutdown
- }).finally([server, fp_server = std::move(fp_server)] () mutable {
+ }).then([server, fp_server = std::move(fp_server)] () mutable {
return server->shutdown().then([cleanup = std::move(fp_server)] {});
});
}