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

_ProactorReadPipeTransport pause_reading()/resume_reading() broken if called before any read is perfored #71006

Closed
FulvioEsposito mannequin opened this issue Apr 21, 2016 · 4 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes topic-asyncio type-bug An unexpected behavior, bug, or error

Comments

@FulvioEsposito
Copy link
Mannequin

FulvioEsposito mannequin commented Apr 21, 2016

BPO 26819
Nosy @asvetlov, @1st1, @miss-islington
PRs
  • bpo-26819: Prevent proactor double read on resume #6921
  • [3.7] bpo-26819: Prevent proactor double read on resume (GH-6921) #7004
  • [3.6] bpo-26819: Prevent proactor double read on resume (GH-6921) #7110
  • Files
  • pause_resume_test.py: Minimal test case to reproduce the issue
  • 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-05-25.08:03:58.176>
    created_at = <Date 2016-04-21.17:34:00.917>
    labels = ['3.8', 'type-bug', '3.7', 'expert-asyncio']
    title = '_ProactorReadPipeTransport pause_reading()/resume_reading() broken if called before any read is perfored'
    updated_at = <Date 2018-05-25.08:03:58.176>
    user = 'https://bugs.python.org/FulvioEsposito'

    bugs.python.org fields:

    activity = <Date 2018-05-25.08:03:58.176>
    actor = 'asvetlov'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-05-25.08:03:58.176>
    closer = 'asvetlov'
    components = ['asyncio']
    creation = <Date 2016-04-21.17:34:00.917>
    creator = 'Fulvio Esposito'
    dependencies = []
    files = ['42559']
    hgrepos = []
    issue_num = 26819
    keywords = ['patch']
    message_count = 4.0
    messages = ['263927', '317161', '317164', '317661']
    nosy_count = 4.0
    nosy_names = ['asvetlov', 'yselivanov', 'Fulvio Esposito', 'miss-islington']
    pr_nums = ['6921', '7004', '7110']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue26819'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8']

    @FulvioEsposito
    Copy link
    Mannequin Author

    FulvioEsposito mannequin commented Apr 21, 2016

    Calling pause_reading()/resume_reading() on a _ProactorReadPipeTransport will result in an InvalidStateError('Result is not ready.') from a future if no read has been issued yet. The reason is that resume_reading() will schedule _loop_reading() a second time on the event loop. For example, currently aiomysql always fails to connect using a ProactorEventLoop on Windows because it calls pause_reading()/resume_reading() to set TCP_NODELAY on the socket just after connecting and before any read is performed.

    @FulvioEsposito FulvioEsposito mannequin added topic-asyncio type-bug An unexpected behavior, bug, or error labels Apr 21, 2016
    @serhiy-storchaka serhiy-storchaka added 3.7 (EOL) end of life 3.8 only security fixes labels May 17, 2018
    @asvetlov
    Copy link
    Contributor

    New changeset 4151061 by Andrew Svetlov (CtrlZvi) in branch 'master':
    bpo-26819: Prevent proactor double read on resume (bpo-6921)
    4151061

    @miss-islington
    Copy link
    Contributor

    New changeset 28ea38b by Miss Islington (bot) in branch '3.7':
    bpo-26819: Prevent proactor double read on resume (GH-6921)
    28ea38b

    @asvetlov
    Copy link
    Contributor

    New changeset 749afe8 by Andrew Svetlov (CtrlZvi) in branch '3.6':
    [3.6] bpo-26819: Prevent proactor double read on resume (GH-6921) (bpo-7110)
    749afe8

    @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
    Labels
    3.7 (EOL) end of life 3.8 only security fixes topic-asyncio type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants