Update simple_httpclient.py #773

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@mariusbucur

Fix bug where an async call to _process_queue in _release_fetch might render self.queue empty causing the popleft() call in simple_httpclient.py:93 to fail.

@mariusbucur mariusbucur Update simple_httpclient.py
Fix bug where an async call to _process_queue in _release_fetch might render self.queue empty causing the popleft() call in simple_httpclient.py:93 to fail.
f72cdac
Owner
bdarnell commented May 1, 2013

It shouldn't be possible for the queue to become empty in between "while self.queue" and "self.queue.popleft()" unless you're accessing the HTTP client from multiple threads. All access to the AsyncHTTPClient must be done on its IOLoop's thread.

Thanks a lot for the response, you are right. I was accidentally calling
client.fetch() from another thread.

Thanks,
-Marius

On Wed, May 1, 2013 at 3:12 AM, bdarnell notifications@github.com wrote:

It shouldn't be possible for the queue to become empty in between "while
self.queue" and "self.queue.popleft()" unless you're accessing the HTTP
client from multiple threads. All access to the AsyncHTTPClient must be
done on its IOLoop's thread.


Reply to this email directly or view it on GitHubhttps://github.com/facebook/tornado/pull/773#issuecomment-17263808
.

@bdarnell bdarnell closed this May 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment