vladmunteanu / th2c

Tornado HTTP/2 Client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stream cleanup from connection fails with KeyError.

vladmunteanu opened this issue · comments

in Stream.finish, the line self.connection.end_stream(self) can raise:
Exception in callback <functools.partial object at 0x7fef7c1355d0>#012 Traceback (most recent call last):#012 File "/usr/local/lib/python2.7/dist-packages/tornado/ioloop.py", line 605, in _run_callback#012 ret = callback()#012 File "/usr/local/lib/python2.7/dist-packages/tornado/stack_context.py", line 277, in null_wrapper#012 return fn(*args, **kwargs)#012 File "/usr/local/lib/python2.7/dist-packages/th2c/stream.py", line 78, in on_timeout#012 None#012 File "/usr/local/lib/python2.7/dist-packages/th2c/stream.py", line 86, in handle_exception#012 self.finish(val)#012 File "/usr/local/lib/python2.7/dist-packages/th2c/stream.py", line 259, in finish#012 self.connection.end_stream(self)#012 File "/usr/local/lib/python2.7/dist-packages/th2c/connection.py", line 417, in end_stream#012 del self._ongoing_streams[stream.stream_id]#012KeyError: 3

Noticed this after a RequestTimeout exception