uber / tchannel-python

Python implementation of the TChannel protocol.
MIT License
76 stars 45 forks source link

connection: Fix assert loop running errors #462

Closed abhinav closed 8 years ago

abhinav commented 8 years ago

It seems that there are cases where a handshake is performed and before the next call is finished, the connection disconnects. Before 0.30.4, this would cause a StreamClosedError that would be retried, but now that we're actually updating the loop_running variable, it causes an assertion error.

The only reason we have loop_running is to track whether a handshake was performed. With this change, we track it explicitly and don't unset it once the handshake is performed. This should address the assertion error people were seeing.

One of the asserts was removed because it has a while not self.closed loop immediately afterwards, which would cause the loop to end.

@blampe @willhug

abhinav commented 8 years ago

released in 0.30.5