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

asyncio: is it time to make ProactorEventLoop as the default event loop? #78868

Closed
vstinner opened this issue Sep 14, 2018 · 9 comments
Closed

Comments

@vstinner
Copy link
Member

vstinner commented Sep 14, 2018

BPO 34687
Nosy @vstinner, @asvetlov, @1st1, @miss-islington, @carltongibson
PRs
  • bpo-34687: asynico uses ProactorEventLoop by default #9538
  • bpo-34687: Update asyncio doc for ProactorEventLoop #9623
  • 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 = None
    closed_at = <Date 2018-09-25.15:31:18.247>
    created_at = <Date 2018-09-14.19:35:17.919>
    labels = ['3.8', 'expert-asyncio']
    title = 'asyncio: is it time to make ProactorEventLoop as the default event loop?'
    updated_at = <Date 2019-10-23.12:14:41.970>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2019-10-23.12:14:41.970>
    actor = 'carltongibson'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-09-25.15:31:18.247>
    closer = 'vstinner'
    components = ['asyncio']
    creation = <Date 2018-09-14.19:35:17.919>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34687
    keywords = ['patch']
    message_count = 9.0
    messages = ['325391', '325394', '326361', '326363', '326424', '326641', '355210', '355211', '355215']
    nosy_count = 5.0
    nosy_names = ['vstinner', 'asvetlov', 'yselivanov', 'miss-islington', 'carltongibson']
    pr_nums = ['9538', '9623']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue34687'
    versions = ['Python 3.8']

    @vstinner
    Copy link
    Member Author

    vstinner commented Sep 14, 2018

    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

    @1st1
    Copy link
    Member

    1st1 commented Sep 14, 2018

    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?

    @1st1
    Copy link
    Member

    1st1 commented Sep 25, 2018

    New changeset 6ea29c5 by Yury Selivanov (Victor Stinner) in branch 'master':
    bpo-34687: Make asynico use ProactorEventLoop by default (GH-9538)
    6ea29c5

    @vstinner
    Copy link
    Member Author

    vstinner commented Sep 25, 2018

    Thank you for the review Yury ;-)

    @asvetlov
    Copy link
    Contributor

    asvetlov commented Sep 26, 2018

    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.

    @miss-islington
    Copy link
    Contributor

    miss-islington commented Sep 28, 2018

    New changeset 37aae9d by Miss Islington (bot) (Victor Stinner) in branch 'master':
    bpo-34687: Update asyncio doc for ProactorEventLoop (GH-9623)
    37aae9d

    @carltongibson
    Copy link
    Mannequin

    carltongibson mannequin commented Oct 23, 2019

    This change causes an issue in asgiref (and so Django) for Windows and Python 3.8.

    django/asgiref#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?)

    @vstinner
    Copy link
    Member Author

    vstinner commented Oct 23, 2019

    (I'm guessing I need to create a new issue?)

    Please open a new issue.

    @carltongibson
    Copy link
    Mannequin

    carltongibson mannequin commented Oct 23, 2019

    Created: https://bugs.python.org/issue38563

    Thanks!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants