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.Queue, put() leaks memory if the queue is full #76755

Closed
jmf-mordis mannequin opened this issue Jan 16, 2018 · 2 comments
Closed

asyncio.Queue, put() leaks memory if the queue is full #76755

jmf-mordis mannequin opened this issue Jan 16, 2018 · 2 comments
Labels
3.7 (EOL) end of life performance Performance or resource usage topic-asyncio

Comments

@jmf-mordis
Copy link
Mannequin

jmf-mordis mannequin commented Jan 16, 2018

BPO 32574
Nosy @asvetlov, @1st1, @jmf-mordis
PRs
  • bpo-32574: asyncio.Queue, put() leaks memory #5208
  • Files
  • asyncio_put_memory_leak.py: Memory leak example
  • 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-01-25.23:46:23.605>
    created_at = <Date 2018-01-16.19:53:39.008>
    labels = ['expert-asyncio', '3.7', 'performance']
    title = 'asyncio.Queue, put() leaks memory if the queue is full'
    updated_at = <Date 2018-01-25.23:46:23.605>
    user = 'https://github.com/jmf-mordis'

    bugs.python.org fields:

    activity = <Date 2018-01-25.23:46:23.605>
    actor = 'yselivanov'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-01-25.23:46:23.605>
    closer = 'yselivanov'
    components = ['asyncio']
    creation = <Date 2018-01-16.19:53:39.008>
    creator = 'Mordis'
    dependencies = []
    files = ['47388']
    hgrepos = []
    issue_num = 32574
    keywords = ['patch']
    message_count = 2.0
    messages = ['310107', '310718']
    nosy_count = 3.0
    nosy_names = ['asvetlov', 'yselivanov', 'Mordis']
    pr_nums = ['5208']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue32574'
    versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

    @jmf-mordis
    Copy link
    Mannequin Author

    jmf-mordis mannequin commented Jan 16, 2018

    Repro: asyncio queue with limited size and the queue full, call asyncio.wait_for(some_queue.put(1), some_timeout). Every canceled put produces a new item in queue._putters that is never deleted (memory leak).

    Uploaded to the issue a file with an example.

    The get method had a very similar bug which was fixed in 2016-11. The related issue:
    https://bugs.python.org/issue31620

    I already have the code for the PR prepared, so I want to publish the link of the MR in a few of minutes.

    @jmf-mordis jmf-mordis mannequin added 3.7 (EOL) end of life topic-asyncio performance Performance or resource usage labels Jan 16, 2018
    @1st1
    Copy link
    Member

    1st1 commented Jan 25, 2018

    New changeset c47dacb by Yury Selivanov (José Melero Fernández) in branch 'master':
    bpo-32574: Fix leaks in asyncio.Queue.put() and .get() (bpo-5208)
    c47dacb

    @1st1 1st1 closed this as completed Jan 25, 2018
    @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 performance Performance or resource usage topic-asyncio
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant