acelyc111 commented on code in PR #1914:
URL:
https://github.com/apache/incubator-pegasus/pull/1914#discussion_r1500370713
##########
src/zookeeper/zookeeper_session.cpp:
##########
@@ -158,27 +167,48 @@ int zookeeper_session::attach(void *callback_owner, const
state_callback &cb)
{
utils::auto_write_lock l(_watcher_lock);
if (nullptr == _handle) {
- if (FLAGS_enable_zookeeper_kerberos) {
+ if (utils::is_empty(FLAGS_sasl_mechanisms_type)) {
+ _handle = zookeeper_init(
+ FLAGS_hosts_list, global_watcher, FLAGS_timeout_ms, nullptr,
this, 0);
+ } else {
+ int err = sasl_client_init(nullptr);
Review Comment:
I see, so how about this:
```
utils::auto_write_lock l(_watcher_lock);
do {
if (nullptr != _handle) {
break;
}
if (<kerberos_is_disabled>) {
...
break;
}
int err = sasl_client_init(nullptr);
...
} while (false);
CHECK_NOTNULL(_handle, "zookeeper session init failed");
...
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]