Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

KeyError exception in SimpleAsyncHTTPClient._on_fetch_complete() #315

ghost opened this Issue Jul 27, 2011 · 2 comments


None yet
1 participant

ghost commented Jul 27, 2011

We're seeing this exception occur at some relatively rare frequency. No idea how to reproduce it, but the stack trace seems to indicate it's happening at some point during a connection timeout.

Uncaught exception KeyError(<object object at 0xd62a10>,):
 Traceback (most recent call last):
   File "/usr/local/lib/python2.7/dist-packages/tornado/ioloop.py", line 370, in _run_callback
   File "/usr/local/lib/python2.7/dist-packages/tornado/stack_context.py", line 159, in wrapped
     callback(*args, **kwargs)
   File "/usr/local/lib/python2.7/dist-packages/tornado/iostream.py", line 235, in wrapper
   File "/usr/local/lib/python2.7/dist-packages/tornado/stack_context.py", line 183, in wrapped
     callback(*args, **kwargs)
   File "/usr/local/lib/python2.7/dist-packages/tornado/stack_context.py", line 96, in __exit__
     return self.context.__exit__(type, value, traceback)
   File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__
     self.gen.throw(type, value, traceback)
   File "/usr/local/lib/python2.7/dist-packages/tornado/simple_httpclient.py", line 265, in cleanup
     callback(HTTPResponse(self.request, 599, error=e))
   File "/usr/local/lib/python2.7/dist-packages/tornado/simple_httpclient.py", line 113, in _on_fetch_complete
     del self.active[key]
 KeyError: <object object at 0xd62a10>

It appears _on_fetch_complete() is being called twice for the same key.


bdarnell commented Jul 28, 2011

There have been a couple of fixes since the 2.0 release that should remove the possibility of double callbacks. I don't think this should happen any more with the current master branch.


ghost commented Jul 28, 2011

Thanks! We're looking forward to getting those fixes when they hit a stable release.

@bdarnell bdarnell closed this May 27, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment