Repository navigation
Asyncio can't close sockets properly on Linux cause CLOSE_WAIT #87349
Description
Activity
- added3.8 (EOL)end of lifeend of lifetype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Feb 10, 2021 I wrote a simple proxy with Python3.8 and Asyncio, but I found it couldn't handle passive close correctly, a lot of CLOSE_WAIT sockets couldn't be released. I had trouble shot it for a long time with no progress.
netstat -anop tcp | grep CLOSE_WAIT
tcp6 0 0 64.XXX.XXX.XXX:80 113.58.229.12:46996 CLOSE_WAIT 10486/python3.8 off (0.00/0/0)
tcp6 0 0 64.XXX.XXX.XXX:80 222.137.35.237:54914 CLOSE_WAIT 10485/python3.8 off (0.00/0/0)
tcp6 0 0 64.XXX.XXX.XXX:80 119.39.47.229:53882 CLOSE_WAIT 10486/python3.8 off (0.00/0/0)
tcp6 0 0 64.XXX.XXX.XXX:80 123.14.254.238:49262 CLOSE_WAIT 10486/python3.8 off (0.00/0/0)
tcp6 0 0 64.XXX.XXX.XXX:80 121.57.230.51:35036 CLOSE_WAIT 10486/python3.8 off (0.00/0/0)
tcp6 0 0 64.XXX.XXX.XXX:80 124.235.138.253:44882 CLOSE_WAIT 10486/python3.8 off (0.00/0/0)
tcp6 0 0 64.XXX.XXX.XXX:80 36.5.157.219:38006 CLOSE_WAIT 10486/python3.8 off (0.00/0/0)
tcp6 0 0 64.XXX.XXX.XXX:80 150.255.5.121:39288 CLOSE_WAIT 10486/python3.8 off (0.00/0/0)- added3.7 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of life3.10 (EOL)end of lifeend of life
on Feb 10, 2021 - added3.7 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of life3.10 (EOL)end of lifeend of life
on Feb 10, 2021 What was the resolution for this issue? I'm experiencing asyncio.StreamReader.readline() hanging forever on a socket in CLOSE_WAIT state.
I created a new issue for my bug here: https://bugs.python.org/issue44805
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:
bugs.python.org fields: