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.

Title: Wait for connection_lost in StreamWriter.drain
Type: behavior Stage: patch review
Components: asyncio Versions: Python 3.8, Python 3.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, miss-islington, vstinner, yselivanov
Priority: normal Keywords: patch

Created on 2019-05-05 13:44 by asvetlov, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 13098 merged asvetlov, 2019-05-05 14:00
PR 13176 merged miss-islington, 2019-05-07 20:53
PR 13328 merged vstinner, 2019-05-14 20:04
PR 13329 closed vstinner, 2019-05-14 20:28
PR 13330 merged asvetlov, 2019-05-14 21:05
Messages (6)
msg341445 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2019-05-05 13:44
Now `await writer.drain()` performs `await sleep(0)` if underlying transport is closing.

It works well only for plain sockets. SSL transport needs more context switches to shut down the SSL connection.
Drain wakes up too early to check if the transport is actually closed.
msg341820 - (view) Author: miss-islington (miss-islington) Date: 2019-05-07 20:53
New changeset 1cc0ee7d9f6a2817918fafd24c18d8bb093a85d3 by Miss Islington (bot) (Andrew Svetlov) in branch 'master':
bpo-36801: Fix waiting in StreamWriter.drain for closing SSL transport (GH-13098)
msg341834 - (view) Author: miss-islington (miss-islington) Date: 2019-05-07 21:48
New changeset 93aa57ac6594d1cc30d147720fc8a7a4e1ca2d3e by Miss Islington (bot) in branch '3.7':
bpo-36801: Fix waiting in StreamWriter.drain for closing SSL transport (GH-13098)
msg342513 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2019-05-14 20:13
Looks like the change introduced by the PR is not stable at least on Windows boxes
msg342516 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-05-14 20:30
New changeset c647ad9b51c59f71c02cd90c5e67d1b2768323ca by Victor Stinner in branch '3.7':
Revert "bpo-36801: Fix waiting in StreamWriter.drain for closing SSL transport (GH-13098)" (GH-13328)
msg342521 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2019-05-14 21:39
New changeset 54b74fe9df89f0e5646736f1f60376b4e37c422c by Andrew Svetlov in branch 'master':
bpo-36801: Temporarily fix regression in writer.drain() (#13330)
Date User Action Args
2022-04-11 14:59:14adminsetgithub: 80982
2019-05-14 21:39:18asvetlovsetmessages: + msg342521
2019-05-14 21:05:46asvetlovsetpull_requests: + pull_request13242
2019-05-14 20:30:05vstinnersetnosy: + vstinner
messages: + msg342516
2019-05-14 20:28:23vstinnersetstage: patch review
pull_requests: + pull_request13241
2019-05-14 20:13:13asvetlovsetstatus: closed -> open
resolution: fixed ->
messages: + msg342513

stage: resolved -> (no value)
2019-05-14 20:04:23vstinnersetpull_requests: + pull_request13240
2019-05-07 21:48:39miss-islingtonsetmessages: + msg341834
2019-05-07 21:28:27asvetlovsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-05-07 20:53:31miss-islingtonsetpull_requests: + pull_request13092
2019-05-07 20:53:22miss-islingtonsetnosy: + miss-islington
messages: + msg341820
2019-05-05 18:24:46asvetlovsetversions: + Python 3.7
2019-05-05 14:00:41asvetlovsetkeywords: + patch
stage: patch review
pull_requests: + pull_request13011
2019-05-05 13:44:32asvetlovcreate