From: Radoslaw Zarzynski Date: Wed, 5 Aug 2020 15:39:45 +0000 (-0400) Subject: crimson/osd: adapt to the new interface of seastar::when_all_succeed(). X-Git-Tag: v16.1.0~1424^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d483c52375e374c2ada96e40f89cc0013c2946d8;p=ceph.git crimson/osd: adapt to the new interface of seastar::when_all_succeed(). Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/crimson/admin/admin_socket.cc b/src/crimson/admin/admin_socket.cc index 02d9deafff64..29ad2095bab6 100644 --- a/src/crimson/admin/admin_socket.cc +++ b/src/crimson/admin/admin_socket.cc @@ -510,7 +510,10 @@ seastar::future<> AdminSocket::register_admin_commands() register_command(std::make_unique()), register_command(std::make_unique()), register_command(std::make_unique()), - register_command(std::make_unique())); + register_command(std::make_unique()) + ).then_unpack([] { + return seastar::now(); + }); } } // namespace crimson::admin diff --git a/src/crimson/mon/MonClient.cc b/src/crimson/mon/MonClient.cc index ebce8bd3421d..34b8824568a3 100644 --- a/src/crimson/mon/MonClient.cc +++ b/src/crimson/mon/MonClient.cc @@ -500,7 +500,7 @@ void Client::tick() if (active_con) { return seastar::when_all_succeed(active_con->get_conn()->keepalive(), active_con->renew_tickets(), - active_con->renew_rotating_keyring()); + active_con->renew_rotating_keyring()).then_unpack([] {}); } else { return seastar::now(); } @@ -796,7 +796,7 @@ seastar::future<> Client::handle_monmap(crimson::net::Connection* conn, logger().info("handle_monmap: renewing tickets"); return seastar::when_all_succeed( active_con->renew_tickets(), - active_con->renew_rotating_keyring()).then([](){ + active_con->renew_rotating_keyring()).then_unpack([](){ logger().info("handle_mon_map: renewed tickets"); }); } else { diff --git a/src/crimson/net/Protocol.cc b/src/crimson/net/Protocol.cc index 78578a5959aa..f89f589adef1 100644 --- a/src/crimson/net/Protocol.cc +++ b/src/crimson/net/Protocol.cc @@ -93,7 +93,9 @@ void Protocol::close(bool dispatch_reset, return seastar::now(); }), std::move(reset_dispatched) - ).finally(std::move(cleanup)); + ).then_unpack([] { + return seastar::now(); + }).finally(std::move(cleanup)); } seastar::future<> Protocol::send(MessageRef msg) diff --git a/src/crimson/net/Socket.cc b/src/crimson/net/Socket.cc index 75c215bf144f..1aabd4ced422 100644 --- a/src/crimson/net/Socket.cc +++ b/src/crimson/net/Socket.cc @@ -132,7 +132,9 @@ seastar::future<> Socket::close() { return seastar::when_all_succeed( in.close(), close_and_handle_errors(out) - ).handle_exception([] (auto eptr) { + ).then_unpack([] { + return seastar::now(); + }).handle_exception([] (auto eptr) { logger().error("Socket::close(): unexpected exception {}", eptr); ceph_abort(); }); diff --git a/src/crimson/osd/heartbeat.cc b/src/crimson/osd/heartbeat.cc index d92401bc3ab5..6103bdf53ced 100644 --- a/src/crimson/osd/heartbeat.cc +++ b/src/crimson/osd/heartbeat.cc @@ -65,7 +65,7 @@ seastar::future<> Heartbeat::start(entity_addrvec_t front_addrs, start_messenger(*back_msgr, back_addrs, chained_dispatchers)) - .then([this] { + .then_unpack([this] { timer.arm_periodic( std::chrono::seconds(local_conf()->osd_heartbeat_interval)); }); @@ -95,6 +95,8 @@ seastar::future<> Heartbeat::stop() return gate.close().then([this] { return seastar::when_all_succeed(front_msgr->shutdown(), back_msgr->shutdown()); + }).then_unpack([] { + return seastar::now(); }); } diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index 8454780f4ca1..d1f55ddc7818 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -166,7 +166,7 @@ seastar::future<> OSD::mkfs(uuid_d osd_uuid, uuid_d cluster_fsid) return when_all_succeed( store->write_meta("ceph_fsid", cluster_fsid.to_string()), store->write_meta("whoami", std::to_string(whoami))); - }).then([cluster_fsid, this] { + }).then_unpack([cluster_fsid, this] { fmt::print("created object store {} for osd.{} fsid {}\n", local_conf().get_val("osd_data"), whoami, cluster_fsid); @@ -277,10 +277,10 @@ seastar::future<> OSD::start() .then([this, chained_dispatchers]() mutable { return public_msgr->start(chained_dispatchers); })); - }).then([this] { + }).then_unpack([this] { return seastar::when_all_succeed(monc->start(), mgrc->start()); - }).then([this] { + }).then_unpack([this] { return _add_me_to_crush(); }).then([this] { monc->sub_want("osd_pg_creates", last_pg_create_epoch, 0); @@ -430,6 +430,8 @@ seastar::future<> OSD::start_asok_admin() asok->register_command(make_asok_hook(*this)), asok->register_command(make_asok_hook(*this)), asok->register_command(make_asok_hook(*this))); + }).then_unpack([] { + return seastar::now(); }); } @@ -472,6 +474,8 @@ seastar::future<> OSD::stop() return when_all_succeed( public_msgr->shutdown(), cluster_msgr->shutdown()); + }).then_unpack([] { + return seastar::now(); }).handle_exception([](auto ep) { logger().error("error while stopping osd: {}", ep); }); diff --git a/src/crimson/osd/osd_operations/pg_advance_map.cc b/src/crimson/osd/osd_operations/pg_advance_map.cc index ec30841a12f9..a96479d4076e 100644 --- a/src/crimson/osd/osd_operations/pg_advance_map.cc +++ b/src/crimson/osd/osd_operations/pg_advance_map.cc @@ -86,7 +86,7 @@ seastar::future<> PGAdvanceMap::start() osd.shard_services.dispatch_context( pg->get_collection_ref(), std::move(rctx))); - }).then([this] { + }).then_unpack([this] { return osd.shard_services.send_pg_temp(); }); }).then([this, ref=std::move(ref)] { diff --git a/src/crimson/osd/shard_services.cc b/src/crimson/osd/shard_services.cc index b52cdfb7ecbb..46c6d710df6e 100644 --- a/src/crimson/osd/shard_services.cc +++ b/src/crimson/osd/shard_services.cc @@ -137,7 +137,10 @@ seastar::future<> ShardServices::dispatch_context( return seastar::when_all_succeed( dispatch_context_messages( BufferedRecoveryMessages{ceph_release_t::octopus, ctx}), - col ? dispatch_context_transaction(col, ctx) : seastar::now()); + col ? dispatch_context_transaction(col, ctx) : seastar::now() + ).then_unpack([] { + return seastar::now(); + }); } void ShardServices::queue_want_pg_temp(pg_t pgid, diff --git a/src/tools/crimson/perf_crimson_msgr.cc b/src/tools/crimson/perf_crimson_msgr.cc index 30793487d780..1efef3a2f574 100644 --- a/src/tools/crimson/perf_crimson_msgr.cc +++ b/src/tools/crimson/perf_crimson_msgr.cc @@ -661,7 +661,7 @@ static seastar::future<> run( return seastar::when_all_succeed( server->init(server_conf.v1_crc_enabled, server_conf.addr), client->init(client_conf.v1_crc_enabled) - ).then([client, addr = client_conf.server_addr] { + ).then_unpack([client, addr = client_conf.server_addr] { return client->connect_wait_verify(addr); }).then([client, ramptime = client_conf.ramptime, msgtime = client_conf.msgtime] {