From aca366179e83ad17c00062d39c42c09dc6a3bd46 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Sat, 25 Aug 2018 15:28:52 +0100 Subject: [PATCH] Fix for dropout errors --- sirius/protocol/protocol_loop.py | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.47.3