Issue 27746: ResourceWarnings in test_asyncio (original) (raw)

Created on 2016-08-12 12:13 by martin.panter, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue27746.patch xiang.zhang,2016-08-18 08:30 review
Messages (9)
msg272529 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-08-12 12:13
$ ./python -bWerror -m test -r -u all . . . 0:12:58 [ 70/402] test_asyncio Exception ignored in: <bound method _SSLProtocolTransport.__del__ of <asyncio.sslproto._SSLProtocolTransport object at 0x7fed4638f0c0>> Traceback (most recent call last): File "/media/disk/home/proj/python/cpython/Lib/asyncio/sslproto.py", line 329, in __del__ source=self) ResourceWarning: unclosed transport <asyncio.sslproto._SSLProtocolTransport object at 0x7fed4638f0c0> Exception ignored in: <bound method _SSLProtocolTransport.__del__ of <asyncio.sslproto._SSLProtocolTransport object at 0x7fed46317c88>> Traceback (most recent call last): File "/media/disk/home/proj/python/cpython/Lib/asyncio/sslproto.py", line 329, in __del__ source=self) ResourceWarning: unclosed transport <asyncio.sslproto._SSLProtocolTransport object at 0x7fed46317c88> Exception ignored in: <bound method _SSLProtocolTransport.__del__ of <asyncio.sslproto._SSLProtocolTransport object at 0x7fed46310f60>> Traceback (most recent call last): File "/media/disk/home/proj/python/cpython/Lib/asyncio/sslproto.py", line 329, in __del__ source=self) ResourceWarning: unclosed transport <asyncio.sslproto._SSLProtocolTransport object at 0x7fed46310f60> Executing <Task finished coro=<CoroutineTests.test_async_def_wrapped..start() done, defined at /media/disk/home/proj/python/cpython/Lib/test/test_asyncio/test_pep492.py:149> result=None created at /media/disk/home/proj/python/cpython/Lib/asyncio/base_events.py:367> took 0.351 seconds If necessary, you should be able to run with python -Wall -X tracemalloc=33 to get a stack dump where the resources (transport objects or whatever) were allocated.
msg272990 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-08-17 21:20
I marked the issue #272989 as a duplicate of this one. Copy of the by Terry J. Reedy: 3.6, Windows 10, debug build. The following appeared before and after pulling and rebuilding today. I am reporting as per Victor's request on pydev list. 0:00:22 [ 52/402] test_asyncio passed F:\Python\dev\36\lib\asyncio\sslproto.py:329: ResourceWarning: unclosed transport <asyncio.sslproto._SSLProtocolTransport object at 0x03B57658> source=self) F:\Python\dev\36\lib\asyncio\sslproto.py:329: ResourceWarning: unclosed transport <asyncio.sslproto._SSLProtocolTransport object at 0x03B57E70> source=self) F:\Python\dev\36\lib\asyncio\sslproto.py:329: ResourceWarning: unclosed transport <asyncio.sslproto._SSLProtocolTransport object at 0x03AA9038> source=self)
msg273017 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-08-18 08:30
From my observations, this is due to transport is forgotten to close in test_connect_accepted_socket. Upload a patch to add the close function.
msg273293 - (view) Author: Paul McGuire (Paul McGuire) Date: 2016-08-21 11:27
I was about to report this same issue - I get the error message even though I explicitly call transport.close(): C:\Python35\lib\asyncio\selector_events.py:582: ResourceWarning: unclosed transport <_SelectorDatagramTransport closing fd=232> It looks like the _sock attribute of the Transport subclasses must be set to None in their close() methods. (The presence of a non-None _sock is used elsewhere as an indicator of whether the transport has been closed or not.
msg273298 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-08-21 14:30
The patch I submitted is about to solve the resource leak in the test suite. Paul, your problem seems to need other triage.
msg273299 - (view) Author: Paul McGuire (Paul McGuire) Date: 2016-08-21 14:47
Ok, I will submit as a separate issue.
msg273313 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-08-21 19:39
@Paul: close() is asynchronous in Python :-)
msg273321 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-08-21 23:46
STINNER Victor added the comment: > @Paul: close() is asynchronous in Python :-) Sorry. Async in asyncio...
msg308815 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2017-12-20 21:06
Fixed in master already.
History
Date User Action Args
2022-04-11 14:58:34 admin set github: 71933
2017-12-20 21:06:23 asvetlov set status: open -> closednosy: + asvetlovmessages: + resolution: out of datestage: patch review -> resolved
2016-08-21 23:46:22 vstinner set messages: +
2016-08-21 19:39:07 vstinner set messages: +
2016-08-21 14:47:07 Paul McGuire set messages: +
2016-08-21 14:30:29 xiang.zhang set messages: +
2016-08-21 11:52:26 martin.panter set stage: needs patch -> patch review
2016-08-21 11:27:42 Paul McGuire set nosy: + Paul McGuiremessages: +
2016-08-18 08:30:10 xiang.zhang set files: + issue27746.patchnosy: + xiang.zhangmessages: + keywords: + patch
2016-08-17 21:20:36 vstinner set messages: +
2016-08-17 21:19:44 vstinner link issue27789 superseder
2016-08-12 12:13:42 martin.panter create