Module: check_mk
Branch: master
Commit: 9d0692ed2ec575d53e2fba1bb55d502b669dca3d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9d0692ed2ec575…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Mar 22 14:39:56 2018 +0100
Don't change a dictionary during iteration. 8-month old bug...
Change-Id: I2fdfd6e2d8f108589ed93a17ac1a38c352ddb590
---
cmk/ec/main.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cmk/ec/main.py b/cmk/ec/main.py
index 1e17751..26534b5 100644
--- a/cmk/ec/main.py
+++ b/cmk/ec/main.py
@@ -1639,7 +1639,8 @@ class EventServer(ECServerThread):
client_sockets[client_socket.fileno()] = (client_socket, address,
"")
# Read data from existing event unix socket connections
- for fd, (cs, address, previous_data) in client_sockets.iteritems():
+ # NOTE: We modify client_socket in the loop, so we need to copy below!
+ for fd, (cs, address, previous_data) in list(client_sockets.iteritems()):
if fd in readable:
# Receive next part of data
try: