From 0eb4fc7ec6181093e6fdffb4e49164d0267e1138 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Thu, 22 Apr 2021 12:29:59 +0200 Subject: [PATCH] mon/MonClient: remove reopen_session() callback mechanism It's been unused for over 5 years, since commit 17d24292b812 ("osd: remove old stats backoff mechanism"). Signed-off-by: Ilya Dryomov (cherry picked from commit 853c04b5a66721755830c5b46b695f6c86cb406b) --- src/mon/MonClient.cc | 12 ------------ src/mon/MonClient.h | 14 ++------------ 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index 207ff8ff8fc87..d35725319f024 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -648,18 +648,6 @@ void MonClient::_finish_auth(int auth_err) _check_auth_tickets(); } auth_cond.notify_all(); - - if (!auth_err) { - Context *cb = nullptr; - if (session_established_context) { - cb = session_established_context.release(); - } - if (cb) { - monc_lock.unlock(); - cb->complete(0); - monc_lock.lock(); - } - } } // --------- diff --git a/src/mon/MonClient.h b/src/mon/MonClient.h index cd5394f5e285c..80262200b612b 100644 --- a/src/mon/MonClient.h +++ b/src/mon/MonClient.h @@ -302,7 +302,6 @@ private: std::list waiting_for_session; utime_t last_rotating_renew_sent; - std::unique_ptr session_established_context; bool had_a_connection; double reopen_interval_multiplier; @@ -467,18 +466,9 @@ public: send_mon_message(MessageRef{m, false}); } void send_mon_message(MessageRef m); - /** - * If you specify a callback, you should not call - * reopen_session() again until it has been triggered. The MonClient - * will behave, but the first callback could be triggered after - * the session has been killed and the MonClient has started trying - * to reconnect to another monitor. - */ - void reopen_session(Context *cb=NULL) { + + void reopen_session() { std::lock_guard l(monc_lock); - if (cb) { - session_established_context.reset(cb); - } _reopen_session(); } -- 2.39.5