From 19a322e73b473c02eb9ab534bd91d6f4805a7100 Mon Sep 17 00:00:00 2001 From: Nitzan Mordechai Date: Wed, 10 May 2023 09:42:07 +0000 Subject: [PATCH] mon/MonClient: before complete auth with error, reopen session When monClient try to authenticate and fail with -EAGAIN there is a possibility that we no longer hunting and not have active_con. that will result of disconnecting the monClient and ticks will continue without having open session. the solution is to check at the end of auth, that we don't have -EAGAIN error, and if we do, reopen the session and on the next tick try auth again Fixes: https://tracker.ceph.com/issues/58379 Signed-off-by: Nitzan Mordechai (cherry picked from commit f8dad00f07f52d58d8ec67083e8bf568deec3277) --- src/mon/MonClient.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index 9c637bf8a8e19..a9fba82883b9e 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -675,6 +675,11 @@ void MonClient::_finish_auth(int auth_err) if (!auth_err && active_con) { ceph_assert(auth); _check_auth_tickets(); + } else if (auth_err == -EAGAIN && !active_con) { + ldout(cct,10) << __func__ + << " auth returned EAGAIN, reopening the session to try again" + << dendl; + _reopen_session(); } auth_cond.notify_all(); } -- 2.39.5