Skip to content

Conversation

@hallfox
Copy link

@hallfox hallfox commented Jun 16, 2021

This PR adds the ability to set the connect_cb function to a Python function object. Through many iterations it has caused us to run into a few deadlocking situations because of the GIL, which is why several rdkafka calls now release it. We are looking for some feedback, but in particular this PR is still missing

  • Windows support
  • Docs
  • Tests

Notably as discussed in #1097 this patch also releases/acquires the GIL in potentially hot paths, so the overall performance impact here is worth some attention.

@ghost
Copy link

ghost commented Jun 16, 2021

It looks like @hallfox hasn't signed our Contributor License Agreement, yet.

The purpose of a CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen licence.
Wikipedia

You can read and sign our full Contributor License Agreement here.

Once you've signed reply with [clabot:check] to prove it.

Appreciation of efforts,

clabot


self->u.Consumer.rebalance_assigned++;

Py_BEGIN_ALLOW_THREADS
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks the indentation doesn't match with the previous code.


Py_BEGIN_ALLOW_THREADS
err = rd_kafka_assign(self->rk, c_parts);
Py_END_ALLOW_THREADS
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

PyObject *error_cb;
PyObject *throttle_cb;
PyObject *stats_cb;
PyObject *connect_cb;
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto


self->u.Consumer.rebalance_assigned++;

Py_BEGIN_ALLOW_THREADS
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor

@jliunyu jliunyu left a comment

Choose a reason for hiding this comment

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

@hallfox, thanks a lot for your change!

Can you please add test case for the code?

@cla-assistant
Copy link

cla-assistant bot commented Aug 15, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants