mirror of
https://github.com/ceph/ceph
synced 2025-01-19 17:41:39 +00:00
Merge pull request #40978 from idryomov/wip-reset-authenticate-err
mon/MonClient: reset authenticate_err in _reopen_session() Reviewed-by: Kefu Chai <kchai@redhat.com> Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
commit
b30d0b8ab5
@ -576,7 +576,6 @@ int MonClient::authenticate(double timeout)
|
|||||||
until += ceph::make_timespan(timeout);
|
until += ceph::make_timespan(timeout);
|
||||||
if (timeout > 0.0)
|
if (timeout > 0.0)
|
||||||
ldout(cct, 10) << "authenticate will time out at " << until << dendl;
|
ldout(cct, 10) << "authenticate will time out at " << until << dendl;
|
||||||
authenticate_err = 1; // == in progress
|
|
||||||
while (!active_con && authenticate_err >= 0) {
|
while (!active_con && authenticate_err >= 0) {
|
||||||
if (timeout > 0.0) {
|
if (timeout > 0.0) {
|
||||||
auto r = auth_cond.wait_until(lock, until);
|
auto r = auth_cond.wait_until(lock, until);
|
||||||
@ -677,18 +676,6 @@ void MonClient::_finish_auth(int auth_err)
|
|||||||
_check_auth_tickets();
|
_check_auth_tickets();
|
||||||
}
|
}
|
||||||
auth_cond.notify_all();
|
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------
|
// ---------
|
||||||
@ -721,6 +708,8 @@ void MonClient::_reopen_session(int rank)
|
|||||||
active_con.reset();
|
active_con.reset();
|
||||||
pending_cons.clear();
|
pending_cons.clear();
|
||||||
|
|
||||||
|
authenticate_err = 1; // == in progress
|
||||||
|
|
||||||
_start_hunting();
|
_start_hunting();
|
||||||
|
|
||||||
if (rank >= 0) {
|
if (rank >= 0) {
|
||||||
|
@ -340,7 +340,6 @@ private:
|
|||||||
|
|
||||||
std::list<MessageRef> waiting_for_session;
|
std::list<MessageRef> waiting_for_session;
|
||||||
utime_t last_rotating_renew_sent;
|
utime_t last_rotating_renew_sent;
|
||||||
std::unique_ptr<Context> session_established_context;
|
|
||||||
bool had_a_connection;
|
bool had_a_connection;
|
||||||
double reopen_interval_multiplier;
|
double reopen_interval_multiplier;
|
||||||
|
|
||||||
@ -504,18 +503,9 @@ public:
|
|||||||
send_mon_message(MessageRef{m, false});
|
send_mon_message(MessageRef{m, false});
|
||||||
}
|
}
|
||||||
void send_mon_message(MessageRef m);
|
void send_mon_message(MessageRef m);
|
||||||
/**
|
|
||||||
* If you specify a callback, you should not call
|
void reopen_session() {
|
||||||
* 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) {
|
|
||||||
std::lock_guard l(monc_lock);
|
std::lock_guard l(monc_lock);
|
||||||
if (cb) {
|
|
||||||
session_established_context.reset(cb);
|
|
||||||
}
|
|
||||||
_reopen_session();
|
_reopen_session();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user