]> git.ipfire.org Git - thirdparty/tornado.git/commit
WaitIterator: don't re-use _running_future
authorAlexander Clausen <alex@gc-web.de>
Sat, 12 Dec 2020 05:58:06 +0000 (06:58 +0100)
committerAlexander Clausen <alex@gc-web.de>
Sat, 12 Dec 2020 05:58:06 +0000 (06:58 +0100)
commit4f3f24b7198f7f9b6aa41fcccc1e4e4151e55c26
tree0cda5c0e3df86ea4da1e35d4b14ba270a56273a1
parentb120df9b584dc59881b72854a4b8e73b16b25159
WaitIterator: don't re-use _running_future

When used with asyncio.Future, WaitIterator may skip indices in some
cases. This is caused by multiple _return_result calls after another,
without having the chain_future call finish in between. This is fixed
here by not hanging on to the _running_future anymore, which forces
subsequent _return_result calls to add to _finished, instead of causing
the previous result to be silently dropped.

Fixes #2034
tornado/gen.py