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 jimmylai
Recipients jimmylai, yselivanov
Date 2017-05-21.13:44:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1495374268.18.0.469758871331.issue30423@psf.upfronthosting.co.za>
In-reply-to
Content
Problem:
"RuntimeError: Event loop stopped before Future completed." throws when calling run_until_complete().

We investigate and find out some orphan futures stay in the event loop before we run another run_until_complete(another_async_func()).
The orphan future has pending state and is attached with _run_until_complete_cb from previous run_until_complete.
It happens because the orphan future thrown Exception and then raise, thus remove_done_callback(_run_until_complete_cb) didn't called.
Move it to finally section can fix it.
With this patch, we stop seeing the Runtime Error.
History
Date User Action Args
2017-05-21 13:44:28jimmylaisetrecipients: + jimmylai, yselivanov
2017-05-21 13:44:28jimmylaisetmessageid: <1495374268.18.0.469758871331.issue30423@psf.upfronthosting.co.za>
2017-05-21 13:44:28jimmylailinkissue30423 messages
2017-05-21 13:44:27jimmylaicreate