This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: add coroutine AbstractEventLoop.sock_close
Type: resource usage Stage:
Components: asyncio Versions: Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, cfy, yselivanov
Priority: normal Keywords:

Created on 2017-07-23 09:30 by cfy, last changed 2022-04-11 14:58 by admin.

Files
File name Uploaded Description Edit
asyncio_wait_forever.py cfy, 2017-07-23 09:30
Messages (2)
msg298894 - (view) Author: Fengyuan Chen (cfy) Date: 2017-07-23 09:30
I suppose asyncio lack async version of sock_close that can call loop.remove_reader and others before close socket and perhaps lack something like coroutine AbstractEventLoop.sock_make_blocking that can do some deregister job.

switch constant in the script:
* change CALL_REMOVE_READING_BEFORE_CLOSE to True will make script running smoothly
* change USE_UVLOOP to True will make script use uvloop
msg308863 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2017-12-21 09:37
Well, removing the reader on future cancellation makes sense.
Can be done by add_done_callback().

Yury, what do you think?
History
Date User Action Args
2022-04-11 14:58:49adminsetgithub: 75179
2017-12-21 09:37:37asvetlovsetnosy: + asvetlov

messages: + msg308863
versions: + Python 3.7
2017-07-23 09:30:07cfycreate