diff options
Diffstat (limited to '')
-rw-r--r-- | src/crimson/osd/osd.cc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/crimson/osd/osd.cc b/src/crimson/osd/osd.cc index 694317f94fe..5986368a41d 100644 --- a/src/crimson/osd/osd.cc +++ b/src/crimson/osd/osd.cc @@ -1265,21 +1265,24 @@ seastar::future<> OSD::prepare_to_stop() { if (osdmap && osdmap->is_up(whoami)) { state.set_prestop(); - return monc->send_message( + const auto timeout = + std::chrono::duration_cast<std::chrono::milliseconds>( + std::chrono::duration<double>( + local_conf().get_val<double>("osd_mon_shutdown_timeout"))); + + return seastar::with_timeout( + seastar::timer<>::clock::now() + timeout, + monc->send_message( make_message<MOSDMarkMeDown>( monc->get_fsid(), whoami, osdmap->get_addrs(whoami), osdmap->get_epoch(), true)).then([this] { - const auto timeout = - std::chrono::duration_cast<std::chrono::milliseconds>( - std::chrono::duration<double>( - local_conf().get_val<double>("osd_mon_shutdown_timeout"))); - return seastar::with_timeout( - seastar::timer<>::clock::now() + timeout, - stop_acked.get_future()); - }).handle_exception_type([this](seastar::timed_out_error&) { + return stop_acked.get_future(); + }) + ).handle_exception_type( + [](seastar::timed_out_error&) { return seastar::now(); }); } |