Issue36840
Created on 2019-05-07 20:10 by asvetlov, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg341811 - (view) | Author: Andrew Svetlov (asvetlov) * | Date: 2019-05-07 20:10 | |
It should call underlying `transport.abort()`, then wait for closing event (`await self.wait_closed()`) |
|||
| msg341813 - (view) | Author: Yury Selivanov (yselivanov) * | Date: 2019-05-07 20:15 | |
If we're just calling socket.close(), then what's the point of waiting for connection_lost? (I remember us discussing this, but I don't quite remember the details). Usually .abort() is a synchronous method, which kind of signals that "i want to close this immediately and I don't care what happens to it". |
|||
| msg341836 - (view) | Author: Andrew Svetlov (asvetlov) * | Date: 2019-05-07 22:14 | |
The reason is: until connection_lost() is called the transport is in the active state. Destruction of closing-but-not-closed-yet trasport raises a ResourceWarning. Plain TCP socket calls connection_lost() on the next loop iteration after .abort() call. SSL transport seems to do the same but in general it can require a few extra loop iterations. Better to make `stream.abort()` async function to avoid problems in the future. Otherwise, you always have to write stream.abort() await stream.wait_closed() which I consider a bad API |
|||
| msg343680 - (view) | Author: Andrew Svetlov (asvetlov) * | Date: 2019-05-27 20:01 | |
Fixed by #36889 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:14 | admin | set | github: 81021 |
| 2019-05-27 20:01:30 | asvetlov | set | status: open -> closed superseder: Merge StreamWriter and StreamReader into just asyncio.Stream messages: + msg343680 resolution: fixed |
| 2019-05-07 22:14:54 | asvetlov | set | messages: + msg341836 |
| 2019-05-07 20:15:52 | yselivanov | set | messages: + msg341813 |
| 2019-05-07 20:10:06 | asvetlov | create | |