]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
CurlAsyncHTTPClient: free_list starvation if setup fails
authorMin RK <benjaminrk@gmail.com>
Wed, 11 Nov 2015 12:22:08 +0000 (13:22 +0100)
committerMin RK <benjaminrk@gmail.com>
Wed, 11 Nov 2015 12:22:08 +0000 (13:22 +0100)
If `_curl_setup_request` fails,
the failing curl instance would be permanently excluded from free_list,
because `_finish` will never be called.
Once this has happens `max_clients` times,
no future request will ever complete.

tornado/curl_httpclient.py

index 22f25023224a7659bf4f3158d8f62062118df7eb..6dadedd9fefb6eb38cce7f77d32e958938201210 100644 (file)
@@ -221,6 +221,7 @@ class CurlAsyncHTTPClient(AsyncHTTPClient):
                         # _process_queue() is called from
                         # _finish_pending_requests the exceptions have
                         # nowhere to go.
+                        self._free_list.append(curl)
                         callback(HTTPResponse(
                             request=request,
                             code=599,