You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ProactorEventLoop.close(): set_wakeup_fd() only works in main thread #82744
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2019-10-23.16:38:10.650>created_at=<Date2019-10-23.12:13:28.326>labels= ['3.8', '3.9', 'type-crash', 'expert-asyncio']
title='ProactorEventLoop.close(): set_wakeup_fd() only works in main thread'updated_at=<Date2019-10-23.16:38:10.650>user='https://github.com/carltongibson'
changed the title [-]Asyncio regression on Windows with Python 3.8[/-][+]ProactorEventLoop.close(): set_wakeup_fd() only works in main thread[/+]on Oct 23, 2019
Activity
carltongibson commentedon Oct 23, 2019
6ea29c5 for
https://bugs.python.org/issue34687
"Make asynico use ProactorEventLoop by default"
This introducesd a regression in asgiref, and hence Django 3.0.x.
django/asgiref#132
https://code.djangoproject.com/ticket/30900
The error from the asgiref issue is clearest:
Off the main thread, we use a ThreadPoolExecutor and wait for the future to finish.
It looks as if
ProactorEventLoopneeds to check the current thread before triggering the signal in close().carltongibson commentedon Oct 23, 2019
Reproduce steps, on Windows with Python 3.8.0, and a clean venv.
git clone https://github.com/django/asgiref.git
cd asgiref
pip install -e .[tests]
py.test .
asvetlov commentedon Oct 23, 2019
Pull Request is welcome!
[-]Asyncio regression on Windows with Python 3.8[/-][+]ProactorEventLoop.close(): set_wakeup_fd() only works in main thread[/+]vstinner commentedon Oct 23, 2019
That's basically the same issue than bpo-34679 but on close() rather than on creating the event loop.
carltongibson commentedon Oct 23, 2019
Thanks for the speedy patch Victor. Great effort!
vstinner commentedon Oct 23, 2019
Can you try to manually test PR 16901?
carltongibson commentedon Oct 23, 2019
OK, that seems fair :) Will do that tomorrow AM.
vstinner commentedon Oct 23, 2019
New changeset 1b53a24 by Victor Stinner in branch 'master':
bpo-34679: ProactorEventLoop only uses set_wakeup_fd() in main thread (GH-16901)
1b53a24
miss-islington commentedon Oct 23, 2019
New changeset cbf474c by Miss Skeleton (bot) in branch '3.8':
bpo-34679: ProactorEventLoop only uses set_wakeup_fd() in main thread (GH-16901)
cbf474c
vstinner commentedon Oct 23, 2019
Yury and Andrew approved my PR 16901, so I merged it.
Thanks for the bug report Carlton Gibson.
carltongibson commentedon Oct 23, 2019
Super turn-around. Thank you all.