Skip to content
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

Merged
merged 3 commits into from
Feb 2, 2023

Conversation

milindl
Copy link
Contributor

@milindl milindl commented Feb 1, 2023

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.

This binding calls internally rd_kafka_sasl_set_credentials.
This binding is needed across consumers, producers, and
adminclient.
@milindl milindl requested review from pranavrth and a team February 1, 2023 06:25
@milindl milindl force-pushed the dev_set_sasl_credentials branch from 517c785 to 5f38678 Compare February 1, 2023 06:28
@milindl milindl force-pushed the dev_set_sasl_credentials branch from 5f38678 to b0f0633 Compare February 1, 2023 07:12
Copy link
Member

@pranavrth pranavrth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix build issue

src/confluent_kafka/src/confluent_kafka.c Outdated Show resolved Hide resolved
return NULL;
}

error = rd_kafka_sasl_set_credentials(self->rk, username, password);
Copy link
Member

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.

Copy link
Contributor Author

@milindl milindl Feb 1, 2023

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

Copy link
Member

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?

Copy link
Contributor

@emasab emasab Feb 2, 2023

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

Copy link
Contributor Author

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

Copy link
Member

@pranavrth pranavrth left a 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);
Copy link
Member

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?

@milindl milindl merged commit 1d1449f into master Feb 2, 2023
@milindl milindl deleted the dev_set_sasl_credentials branch February 2, 2023 09:49
emasab pushed a commit that referenced this pull request Jun 19, 2023
This binding calls internally rd_kafka_sasl_set_credentials.
This binding is needed across consumers, producers, and
adminclient.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants