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.

Author asvetlov
Recipients asvetlov, yselivanov
Date 2019-05-07.22:14:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1557267294.3.0.511469123493.issue36840@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2019-05-07 22:14:54asvetlovsetrecipients: + asvetlov, yselivanov
2019-05-07 22:14:54asvetlovsetmessageid: <1557267294.3.0.511469123493.issue36840@roundup.psfhosted.org>
2019-05-07 22:14:54asvetlovlinkissue36840 messages
2019-05-07 22:14:54asvetlovcreate