Skip to content

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

Merged
gvanrossum merged 1 commit into
python:masterfrom
russelldavis:fix-kqueue-empty-select
Apr 15, 2020
Merged

bpo-29255: Wait in KqueueSelector when no fds are registered#19508
gvanrossum merged 1 commit into
python:masterfrom
russelldavis:fix-kqueue-empty-select

Conversation

@russelldavis

@russelldavis russelldavis commented Apr 14, 2020

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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

matklad commented Apr 14, 2020

Copy link
Copy Markdown

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
Copy Markdown
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).

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

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