➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
标题: asyncio: is it time to make ProactorEventLoop as the default event loop?
类型: Stage: resolved
Components: asyncio Versions: Python 3.8
process
状态: closed Resolution: fixed
Dependencies: 后续:
分配给: 抄送列表: asvetlov, carltongibson, miss-islington, vstinner, yselivanov
优先级: normal 关键字: patch

Created on 2018-09-14 19:35 by vstinner, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 9538 merged vstinner, 2018-09-24 15:03
PR 9623 merged vstinner, 2018-09-28 14:49
Messages (9)
msg325391 - (view) Author: STINNER Victor (vstinner) * (Python committer) 日期: 2018-09-14 19:35
Is it time to make ProactorEventLoop as the default event loop?

Since 2014, many features have been added to ProactorEventLoop (ex: SSL support) and the implementation is way more today than it was 4 years ago.

Comparison of SelectorEventLoop and ProactorEventLoop on Windows:
https://docs.python.org/dev/library/asyncio-platforms.html#windows
msg325394 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) 日期: 2018-09-14 20:13
I'm not sure that ProactorEventLoop is stable enough TBH :(  And I wouldn't be able to be on call for Windows users to fix all bugs in ProactieEventLoop.

Andrew, your thoughts on this?
msg326361 - (view) Author: Yury Selivanov (yselivanov) * (Python committer) 日期: 2018-09-25 15:27
New changeset 6ea29c5e90dde6c240bd8e0815614b52ac307ea1 by Yury Selivanov (Victor Stinner) in branch 'master':
bpo-34687: Make asynico use ProactorEventLoop by default (GH-9538)
https://github.com/python/cpython/commit/6ea29c5e90dde6c240bd8e0815614b52ac307ea1
msg326363 - (view) Author: STINNER Victor (vstinner) * (Python committer) 日期: 2018-09-25 15:31
Thank you for the review Yury ;-)
msg326424 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) 日期: 2018-09-26 07:40
I think the only way to make sure that proactor event loop is stable -- starting to use it everywhere on Windows.

Let's do it.
msg326641 - (view) Author: miss-islington (miss-islington) 日期: 2018-09-28 15:40
New changeset 37aae9dcf18753b8ffda99d1a5758a90af852464 by Miss Islington (bot) (Victor Stinner) in branch 'master':
bpo-34687: Update asyncio doc for ProactorEventLoop (GH-9623)
https://github.com/python/cpython/commit/37aae9dcf18753b8ffda99d1a5758a90af852464
msg355210 - (view) Author: Carlton Gibson (carltongibson) 日期: 2019-10-23 10:12
This change causes an issue in asgiref (and so Django) for Windows and Python 3.8. 

https://github.com/django/asgiref/issues/132
https://code.djangoproject.com/ticket/30900

It looks as if `ProactorEventLoop` needs to check the current thread before triggering the signal... 

```
File "C:\Jenkins\workspace\django-windows\database\sqlite3\label\windows\python\Python38\.env\lib\site-packages\asgiref\sync.py", line 130, in _run_event_loop
File "C:\Python38\lib\asyncio\proactor_events.py", line 679, in close
    signal.set_wakeup_fd(-1)
ValueError: set_wakeup_fd only works in main thread
```

... but I'm not familiar with the internals here as yet. 

(I'm guessing I need to create a new issue?)
msg355211 - (view) Author: STINNER Victor (vstinner) * (Python committer) 日期: 2019-10-23 10:20
> (I'm guessing I need to create a new issue?)

Please open a new issue.
msg355215 - (view) Author: Carlton Gibson (carltongibson) 日期: 2019-10-23 12:14
Created: https://bugs.python.org/issue38563 

Thanks!
历史
日期 用户 动作 参数
2022-04-11 14:59:05admin修改github: 78868
2019-10-23 12:14:41carltongibson修改消息: + msg355215
2019-10-23 10:20:15vstinner修改消息: + msg355211
2019-10-23 10:12:12carltongibson修改抄送: + carltongibson
消息: + msg355210
2018-09-28 15:40:13miss-islington修改抄送: + miss-islington
消息: + msg326641
2018-09-28 14:49:05vstinner修改pull_requests: + pull_request9021
2018-09-26 07:40:56asvetlov修改消息: + msg326424
2018-09-25 15:31:18vstinner修改状态: open -> closed
resolution: fixed
消息: + msg326363

stage: patch review -> resolved
2018-09-25 15:27:21yselivanov修改消息: + msg326361
2018-09-24 15:03:14vstinner修改keywords: + patch
stage: patch review
pull_requests: + pull_request8940
2018-09-14 20:13:31yselivanov修改消息: + msg325394
2018-09-14 19:35:17vstinner创建