-
Notifications
You must be signed in to change notification settings - Fork 901
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
Add set_sasl_credentials binding across clients #1511
Conversation
This binding calls internally rd_kafka_sasl_set_credentials. This binding is needed across consumers, producers, and adminclient.
517c785
to
5f38678
Compare
5f38678
to
b0f0633
Compare
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.
Fix build issue
return NULL; | ||
} | ||
|
||
error = rd_kafka_sasl_set_credentials(self->rk, username, password); |
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.
Check if we need to release GIL.
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.
We are actually doing some operations except just copying of credentials under the sasl.lock that librdkafka has.
I'm not sure how time consuming they are, so I released the GIL
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.
I think release the GIL is correct approach here.
@emasab - What is your thoughts?
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.
Yes, better to use CallState_begin
and CallState_end
because it acquires the mutex rk->rk_conf.sasl.lock
and other locks in rd_kafka_all_brokers_wakeup
that are blocking operations
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.
Great, merging this now since there's agreement to release the GIL
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.
LGTM!
return NULL; | ||
} | ||
|
||
error = rd_kafka_sasl_set_credentials(self->rk, username, password); |
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.
I think release the GIL is correct approach here.
@emasab - What is your thoughts?
This binding calls internally rd_kafka_sasl_set_credentials. This binding is needed across consumers, producers, and adminclient.
This binding calls internally rd_kafka_sasl_set_credentials.
This binding is needed across consumers, producers, and adminclient.
Since this binding is required by all three bindings, I've added it in a common file.
If I need to create a new file, or a new test file, please let me know.