bpo-29255: Wait in KqueueSelector when no fds are registered#19508
Conversation
|
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 MissingOur records indicate the following people have not signed the CLA: 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 You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
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. |
|
@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).
9f0cb86 to
3fc6d93
Compare
gvanrossum
left a comment
There was a problem hiding this comment.
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.
Also partially fixes bpo-25680 (there's still a discrepancy in behavior on Windows that needs to be fixed).
https://bugs.python.org/issue29255