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

bpo-29255: Wait in KqueueSelector when no fds are registered #19508

Merged
merged 1 commit into from
Apr 15, 2020

Conversation

russelldavis
Copy link
Contributor

@russelldavis russelldavis commented Apr 14, 2020

Also partially fixes bpo-25680 (there's still a discrepancy in behavior on Windows that needs to be fixed).

https://bugs.python.org/issue29255

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@russelldavis

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@matklad
Copy link

matklad commented Apr 14, 2020

Also fixes bpo-25680

Not entirely sure, but I think that also needs a separate fix for windows, as all of Linux, Mac and windows behave differently in the case of empty set of selected events. I think this pr only fixes Mac/Linux discrepancy.

@russelldavis
Copy link
Contributor Author

@matklad thanks for the comment, you're right. I just confirmed that on windows, it raises an exception. I've updated the PR description to reflect that.

Also partially fixes bpo-25680 (there's still a discrepancy in behavior
on Windows that needs to be fixed).
Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

I'm not very familiar with the kqueue API, but I looked through the source code for select_kqueue_control_impl and it looks like maxevents is a limit on the number of requested events to be returned from the call, and it looks like it will work correctly -- since there are no fds registered we won't get any events back, but we will get a timeout.

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.

5 participants