]> git.ipfire.org Git - thirdparty/tornado.git/commit
concurrent: Add future_set_exception_unless_cancelled
authorBen Darnell <ben@bendarnell.com>
Sun, 2 Dec 2018 18:11:37 +0000 (13:11 -0500)
committerBen Darnell <ben@bendarnell.com>
Sun, 2 Dec 2018 18:16:13 +0000 (13:16 -0500)
commit449f2aeafa62242d80cf499087d96e33077df022
tree69d3cc606cbd238ff0f40623edaa956a1afdf825
parent940fd87fe9145d1154c8457221f86d56ea063c65
concurrent: Add future_set_exception_unless_cancelled

Tornado's limited support for cancellation means that errors after a
Future is cancelled could get raised (and probably logged) as
InvalidStateErrors.

This new function effectively changes the behavior to log the real
exception instead of the InvalidStateError. We log them instead of
ignoring them because it's generally not a good idea to let errors
pass silently even if they're after the point that no one is listening
for them (this is consistent with the way gen.multi() handles multiple
errors, for example).

Fixes #2540
tornado/concurrent.py
tornado/httpclient.py
tornado/iostream.py
tornado/process.py
tornado/test/httpclient_test.py