New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mgr/MgrClient: use unique_ptr for MgrClient::session #13685
Conversation
* use unique_ptr<MgrSessionState> for MgrClient::session, so we don't leak it. * also reset it in MgrClient::shutdown(), so the connection held by session can be released properly, and hence the MonClient will not be asked for an AuthAuthorizer after being shut down. Fixes: http://tracker.ceph.com/issues/19097 Signed-off-by: Kefu Chai <kchai@redhat.com>
return auth->build_authorizer(service_id); | ||
else | ||
return active_con->get_auth()->build_authorizer(service_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't explain in the commit comment why you no longer try active_con->get_auth(). It sounds like you were just replacing the assert with a message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because the active_con->get_auth()
will be promoted to this->auth
, once the client is authorized. and and we will std::swap()
this->auth
and active_con->get_auth()
with the monc lock, so it's always null. i will update the commit message.
@tchaikov Thanx. |
* there is chance that some connections is still trying to authorize itself after the MonClient is shut down. do not assert in this case, but it is a sign of bug, or bad shutdown sequence, so print a message to dout(). * do not use active_con->get_auth() as an alternative to `this->auth` if it is not available. because we promote the authorized conn in pending_cons as the active_con, and std::swap(active_conn->auth, this->auth) with the monc_lock. so there is no point to return active_con->get_auth(), as it's always null. Signed-off-by: Kefu Chai <kchai@redhat.com>
changelog
@dzafman fixed and repushed |
Awesome work. |
failed tests are either known ones (leaks reported by valgrind, and http://tracker.ceph.com/issues/19099) |
@liewegas because this PR silences lots of false alarm in our "make check" runs, so i merged it once i found the qa runs looked good. |
Fixes: http://tracker.ceph.com/issues/19097