Skip to content

bpo-35310: Clear select() lists before returning upon EINTR #10877

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

Merged
merged 1 commit into from
Dec 5, 2018

Conversation

oranav
Copy link
Contributor

@oranav oranav commented Dec 3, 2018

select() calls are retried on EINTR (per PEP 475). However, if a
timeout was provided and the deadline has passed after running the
signal handlers, we should clear rlist, wlist and xlist since select(2)
left them unmodified.

https://bugs.python.org/issue35310

@oranav
Copy link
Contributor Author

oranav commented Dec 3, 2018

Note pull request #10700; one of these should be merged, the other declined -- as they fix the same problem with different approaches.

@oranav oranav force-pushed the fix-bpo-35310-empty-lists branch from f681e13 to d6d788e Compare December 4, 2018 13:06
@oranav oranav force-pushed the fix-bpo-35310-empty-lists branch from d6d788e to 7f55aa0 Compare December 4, 2018 22:32
@oranav
Copy link
Contributor Author

oranav commented Dec 5, 2018

@vstinner I believe the CI build test failed randomly; can you re-run it please?

@vstinner
Copy link
Member

vstinner commented Dec 5, 2018

Please rebase your change on top of master to retrieve the test_urllib2net fix: https://mail.python.org/pipermail/python-dev/2018-December/155928.html

select() calls are retried on EINTR (per PEP 475).  However, if a
timeout was provided and the deadline has passed after running the
signal handlers, we should clear rlist, wlist and xlist since select(2)
left them unmodified.
@oranav oranav force-pushed the fix-bpo-35310-empty-lists branch from 7f55aa0 to 76ad1e9 Compare December 5, 2018 12:38
@oranav
Copy link
Contributor Author

oranav commented Dec 5, 2018

Done, tests passed

@miss-islington
Copy link
Contributor

Thanks @oranav for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

Thanks @oranav for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 5, 2018
…-10877)

select() calls are retried on EINTR (per PEP 475).  However, if a
timeout was provided and the deadline has passed after running the
signal handlers, rlist, wlist and xlist should be cleared since select(2)
left them unmodified.
(cherry picked from commit 7f52415)

Co-authored-by: Oran Avraham <252748+oranav@users.noreply.github.com>
@bedevere-bot
Copy link

GH-10948 is a backport of this pull request to the 3.6 branch.

@bedevere-bot
Copy link

GH-10949 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 5, 2018
…-10877)

select() calls are retried on EINTR (per PEP 475).  However, if a
timeout was provided and the deadline has passed after running the
signal handlers, rlist, wlist and xlist should be cleared since select(2)
left them unmodified.
(cherry picked from commit 7f52415)

Co-authored-by: Oran Avraham <252748+oranav@users.noreply.github.com>
miss-islington added a commit that referenced this pull request Dec 5, 2018
select() calls are retried on EINTR (per PEP 475).  However, if a
timeout was provided and the deadline has passed after running the
signal handlers, rlist, wlist and xlist should be cleared since select(2)
left them unmodified.
(cherry picked from commit 7f52415)

Co-authored-by: Oran Avraham <252748+oranav@users.noreply.github.com>
miss-islington added a commit that referenced this pull request Dec 5, 2018
select() calls are retried on EINTR (per PEP 475).  However, if a
timeout was provided and the deadline has passed after running the
signal handlers, rlist, wlist and xlist should be cleared since select(2)
left them unmodified.
(cherry picked from commit 7f52415)

Co-authored-by: Oran Avraham <252748+oranav@users.noreply.github.com>
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