BPO | [19299](https://bugs.python.org/issue19299) --- | :--- Nosy | @gvanrossum, @pitrou, @larryhastings Files | [base_event_close.patch](https://bugs.python.org/file32231/base_event_close.patch "Uploaded as text/plain at 2013-10-19.19:10:59 by @pitrou") *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: ```python assignee = 'https://github.com/pitrou' closed_at = created_at = labels = ['tests', 'library', 'performance'] title = 'test_asyncio refleak failures' updated_at = user = 'https://github.com/pitrou' ``` bugs.python.org fields: ```python activity = actor = 'pitrou' assignee = 'pitrou' closed = True closed_date = closer = 'pitrou' components = ['Library (Lib)', 'Tests'] creation = creator = 'pitrou' dependencies = [] files = ['32231'] hgrepos = [] issue_num = 19299 keywords = ['patch'] message_count = 6.0 messages = ['200425', '200482', '200484', '200508', '200511', '200512'] nosy_count = 4.0 nosy_names = ['gvanrossum', 'pitrou', 'larry', 'python-dev'] pr_nums = [] priority = 'high' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = 'resource usage' url = 'https://bugs.python.org/issue19299' versions = ['Python 3.4'] ```
Activity
pitrou commentedon Oct 19, 2013
Either the tests forget to cleanup resources at the end, or the library itself has resource management issues.
$ ./python -Wi -m test -R 3:3 test_asyncio [1/1] test_asyncio beginning 6 repetitions 123456 ...... test_asyncio leaked [240, -677, -158] references, sum=-595 test_asyncio leaked [36, -116, -29] memory blocks, sum=-109pitrou commentedon Oct 19, 2013
It seems the attached patch solves it.
pitrou commentedon Oct 19, 2013
(by the way, the part that really made a difference was losing the reference to the executor. I added the rest out of completeness.)
gvanrossum commentedon Oct 19, 2013
Looks good. How about adding executor.shutdown(wait=False)? E.g.
If that works for you, please commit.
python-dev commentedon Oct 19, 2013
New changeset 4019694a1ce4 by Antoine Pitrou in branch 'default':
Issue bpo-19299: fix refleak test failures in test_asyncio
http://hg.python.org/cpython/rev/4019694a1ce4
pitrou commentedon Oct 19, 2013
Ok, should be fixed now!