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-30643: Fix race condition in signal wakeup in forkserver (followup to PR #1989) #2139

Merged
merged 2 commits into from
Jun 13, 2017

Conversation

pitrou
Copy link
Member

@pitrou pitrou commented Jun 12, 2017

There's an admittedly well-known race condition where ECHILD can arrive just before the C function epoll_wait() and the latter wouldn't therefore return EINTR. The solution is to use set_wakeup_fd(), which was designed to avoid such race conditions.

…hon#1989)

There's an admittedly well-known race condition where ECHILD can arrive
just before the C function epoll_wait() and the latter wouldn't therefore
return EINTR.  The solution is to use set_wakeup_fd(), which was designed
to avoid such race conditions.
@vstinner vstinner changed the title Fix race condition in signal wakeup in forkserver (followup to PR #1989) bpo-30643: Fix race condition in signal wakeup in forkserver (followup to PR #1989) Jun 13, 2017
@pitrou pitrou merged commit 2b5cc5e into python:master Jun 13, 2017
@pitrou pitrou deleted the forkserver_epoll_signal_race branch June 13, 2017 07:46
try:
os.write(sig_w, b'.')
except BlockingIOError:
pass
Copy link
Member

Choose a reason for hiding this comment

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

I like this change :-) Using the existing C signal handler for the write is probably more reliable ;-)

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.

3 participants