]> git.ipfire.org Git - thirdparty/tornado.git/commit
httpclient: Fix warning logged by sync HTTPClient destructor 2544/head
authorBen Darnell <ben@bendarnell.com>
Sun, 2 Dec 2018 17:33:07 +0000 (12:33 -0500)
committerBen Darnell <ben@bendarnell.com>
Sun, 2 Dec 2018 22:48:06 +0000 (17:48 -0500)
commitaa622e724f80e0f7fcee369f75d69d1db13d72f2
treeb1994076cf30d9b0308bac682181ece2730e1bfa
parent940fd87fe9145d1154c8457221f86d56ea063c65
httpclient: Fix warning logged by sync HTTPClient destructor

If an HTTPClient is closed from its destructor instead of an explicit
close() call, it sometimes logs an "inconsistent AsyncHTTPClient
cache" error because the weakrefs appear to get cleaned up in an
unexpected order. Relax the checks in AsyncHTTPClient.close to allow
for a missing value in the instance cache.

Fixes #2539
.travis.yml
tornado/httpclient.py
tornado/test/httpclient_test.py