]> git.aero2k.de Git - sirius.git/commitdiff
Fix for dropout errors
authorJoe Rickerby <joerick@mac.com>
Sat, 25 Aug 2018 14:28:52 +0000 (15:28 +0100)
committerJoe Rickerby <joerick@mac.com>
Sat, 25 Aug 2018 14:29:04 +0000 (15:29 +0100)
sirius/protocol/protocol_loop.py

index f6b6076da99b4d4748e3c533bc9b58006189fc27..5e59dd5f70fbef76917b53fa8b203bfd9c6629a0 100644 (file)
@@ -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