Skip to content

bpo-35310: Retry select() calls on EINTR even if deadline has passed #10700

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fix a bug in ``select.select()`` where a retry does not occur on EINTR if the
deadline has already passed after running the signal handlers. Patch by Oran
Avraham.
4 changes: 2 additions & 2 deletions Modules/selectmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ select_select_impl(PyObject *module, PyObject *rlist, PyObject *wlist,
if (tvp) {
timeout = deadline - _PyTime_GetMonotonicClock();
if (timeout < 0) {
n = 0;
break;
timeout = 0;
/* retry select() with a non-blocking call */
}
_PyTime_AsTimeval_noraise(timeout, &tv, _PyTime_ROUND_CEILING);
/* retry select() with the recomputed timeout */
Expand Down