Copy websockets list before iterating over it to prevent race conditions upon list changed upon iteration

This commit is contained in:
Fabio Manganiello 2019-03-27 02:25:06 +01:00
parent 387ed23e86
commit 68f985d2c6

View file

@ -204,7 +204,8 @@ class HttpBackend(Backend):
loop = get_or_create_event_loop()
for websocket in self.active_websockets:
websockets = self.active_websockets.copy()
for websocket in websockets:
try:
loop.run_until_complete(send_event(websocket))
except websockets.exceptions.ConnectionClosed: