Commit 95b4e5cf authored by Robin Obůrka's avatar Robin Obůrka

monitoring: Add extra lock for monitoring socket

parent 7ca31098
......@@ -111,11 +111,13 @@ class LogMonitoring(MonitoringBase):
class SentinelMonitoring(MonitoringBase):
def __init__(self, box_name, socket):
self.socket = socket
self.socket_lock = threading.Lock()
super().__init__(box_name)
def _store_msg(self, msg_type, payload):
msg = encode_msg(msg_type, payload)
self.socket.send_multipart(msg)
with self.socket_lock:
self.socket.send_multipart(msg)
def Monitoring(box_name, socket=None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment