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.
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