From 71d35eb26d9bcb6c1d4907ed7b63883fc0943ac0 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 10 Jan 2021 14:03:45 +0000 Subject: [PATCH] Locking in bridge table when trimming STAT bridges --- bridge_master.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bridge_master.py b/bridge_master.py index 87af3da..d8a1ca0 100755 --- a/bridge_master.py +++ b/bridge_master.py @@ -352,6 +352,7 @@ def rule_timer_loop(): def statTrimmer(): logger.debug('(ROUTER) STAT trimmer loop started') + BRIDGE_SEMA.acquire(blocking = True) _remove_bridges = [] for _bridge in BRIDGES: _bridge_stat = False @@ -363,6 +364,9 @@ def statTrimmer(): for _bridgerem in _remove_bridges: del BRIDGES[_bridgerem] logger.debug('(ROUTER) STAT bridge %s removed',_bridgerem) + BRIDGE_SEMA.release() + if CONFIG['REPORTS']['REPORT']: + report_server.send_clients(b'bridge updated') # run this every 10 seconds to trim orphaned stream ids