Skip to content

Commit

Permalink
mon/MonClient: before complete auth with error, reopen session
Browse files Browse the repository at this point in the history
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 <nmordech@redhat.com>
  • Loading branch information
NitzanMordhai committed May 11, 2023
1 parent b42a730 commit f8dad00
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mon/MonClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,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();
}
Expand Down

0 comments on commit f8dad00

Please sign in to comment.