Message341836
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 |
|
Date |
User |
Action |
Args |
2019-05-07 22:14:54 | asvetlov | set | recipients:
+ asvetlov, yselivanov |
2019-05-07 22:14:54 | asvetlov | set | messageid: <1557267294.3.0.511469123493.issue36840@roundup.psfhosted.org> |
2019-05-07 22:14:54 | asvetlov | link | issue36840 messages |
2019-05-07 22:14:54 | asvetlov | create | |
|