From: Joe Rickerby Date: Sat, 25 Aug 2018 14:28:52 +0000 (+0100) Subject: Fix for dropout errors X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=aca366179e83ad17c00062d39c42c09dc6a3bd46;p=sirius.git Fix for dropout errors --- diff --git a/sirius/protocol/protocol_loop.py b/sirius/protocol/protocol_loop.py index f6b6076..5e59dd5 100644 --- a/sirius/protocol/protocol_loop.py +++ b/sirius/protocol/protocol_loop.py @@ -143,6 +143,13 @@ def accept(ws): stats.inc('by_type.{}.count'.format(type(message).__name__)) logger.debug("Received %r.", message) + # make sure the bridge_state is still in the bridge_by_address dict. + # (my theory is that the same bridge can lose a connection and make a + # second connection before this loop realises the first connection + # is gone. when the first one does finally error, it removes the + # second's entry instead of its own.) + bridge_by_address[power_on.bridge_address] = bridge_state + _accept_step(message, bridge_state) # If the iterator closes normally then the client closed the