Hello Dan Burkert, Alexey Serbin,

I'd like you to do a code review.  Please visit

    http://gerrit.cloudera.org:8080/4761

to review the following change.

Change subject: Free SASL connection objects when negotiation completes
......................................................................

Free SASL connection objects when negotiation completes

The SASL connections are only currently used during negotiation, and
then can be dropped following that. So, it makes sense to dispose of the
objects as soon as possible from a memory consumption standpoint,
since they probably hold some buffers.

More importantly, though, this also works around a bug I saw
occasionally when running a Kerberized Kudu CLI:

- the CLI main would make some RPC call and get an "unauthorized"
  status.
- it would then drop its reference to the KuduClient and exit.
- this would call Messenger::AllExternalReferencesDropped() which
  initiates an asynchronous shutdown of the reactor threads.
- the main thread would get to 'exit()' and start unloading dynamic
  libraries, including libkrb5.
- the reactor thread would call sasl_dispose on a sasl_connection_t
  during its shutdown sequence, which would crash with an assertion
  failure in k5_mutex.h if this happened after krb5 was unloaded.

Rather than futz with the shutdown sequence of the reactor, it was much
simpler to just dispose the connections earlier as done in this patch.

Change-Id: Ib7aada1e44a80af94c5c069e9f583aedcd78a68b
---
M src/kudu/rpc/sasl_client.cc
M src/kudu/rpc/sasl_server.cc
2 files changed, 17 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/61/4761/1
-- 
To view, visit http://gerrit.cloudera.org:8080/4761
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib7aada1e44a80af94c5c069e9f583aedcd78a68b
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Dan Burkert <[email protected]>

Reply via email to