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

Allow disabling thread wakeup in send_request_to_node #2335

Merged
merged 1 commit into from
Mar 2, 2023

Conversation

yzhan289
Copy link
Contributor

@yzhan289 yzhan289 commented Nov 4, 2022

The Datadog kafka_consumer check uses the kafka-python client library to collect metrics. On very large clusters, it sometimes gets a KafkaTimeoutError similar to the one here. We've been able to work around this by disabling the socket wakeup since our check runs in a single thread (after looking at this old Github issue that was meant to fix the issue). However, we needed to re-implement some parts of the _send_request_to_node() function since the library's version always runs a socket wakeup.

This PR just adds the wakeup argument to _send_request_to_node() to make it easier to skip socket wakeup.

I saw that there's a few other places in the code that calls _client.send() where adding a wakeup argument can be possible (examples: 1, 2), but wasn't sure if those would necessarily be useful.

Let me know if I should do anything else for this PR!


This change is Reviewable

@yzhan289 yzhan289 marked this pull request as ready for review November 4, 2022 18:21
@yzhan289
Copy link
Contributor Author

yzhan289 commented Mar 2, 2023

Closing this PR since it's unlikely to be reviewed due to #2290

@yzhan289 yzhan289 closed this Mar 2, 2023
@jeffwidman
Copy link
Collaborator

Sorry, I missed this previously. I'm 👍 on this, and since it's in the admin client it's not too intrusive into core. I heavily refactored a ton of the admin client and the datadog check, so I am pretty comfortable with this section of code. If you re-open/rebase I can merge.

That said, I probably won't be cutting a release since that's up to @dpkp but at least you can land on master and then pin to a sha upstream in datadog.

@yzhan289
Copy link
Contributor Author

yzhan289 commented Mar 2, 2023

@jeffwidman sounds good, I'll reopen the PR!

@yzhan289 yzhan289 reopened this Mar 2, 2023
Copy link
Collaborator

@jeffwidman jeffwidman left a comment

Choose a reason for hiding this comment

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

Flying blind due to #2356, but this looks like a pretty low-risk change.

@jeffwidman jeffwidman merged commit 7ac6c6e into dpkp:master Mar 2, 2023
hiwakaba pushed a commit to hiwakaba/kafka-python that referenced this pull request Jul 13, 2023
hiwakaba pushed a commit to hiwakaba/kafka-python that referenced this pull request Jul 13, 2023
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.

2 participants