From 6a77a13539f9236ee27094570ead79ed3b70a844 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 7 Jun 2019 16:47:17 -0400 Subject: [PATCH 1/2] Improve error for unserializable collective data XML errors turn out to be unserializable. Catch this general class of problems and provide a less devastating behavior. Doing an xml.fromstring('') is an example of how to trigger it. --- confluent_server/confluent/core.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/core.py b/confluent_server/confluent/core.py index 0846d947..96f92941 100644 --- a/confluent_server/confluent/core.py +++ b/confluent_server/confluent/core.py @@ -706,7 +706,11 @@ def handle_dispatch(connection, cert, dispatch, peername): def _forward_rsp(connection, res): - r = pickle.dumps(res) + try: + r = pickle.dumps(res) + except TypeError: + r = pickle.dumps(Exception( + 'Cannot serialize error, check collective.manager error logs for details' + str(res))) rlen = len(r) if not rlen: return @@ -915,7 +919,7 @@ def dispatch_request(nodes, manager, element, configmanager, inputdata, a = configmanager.get_collective_member(manager) try: remote = socket.create_connection((a['address'], 13001)) - remote.settimeout(90) + remote.settimeout(180) remote = ssl.wrap_socket(remote, cert_reqs=ssl.CERT_NONE, keyfile='/etc/confluent/privkey.pem', certfile='/etc/confluent/srvcert.pem') From 0869669ef68b7de02212a1236ca510ecdcb07850 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 7 Jun 2019 16:57:03 -0400 Subject: [PATCH 2/2] Better isolate system config fault System configuration fault will now be contained to node. --- .../confluent/plugins/hardwaremanagement/ipmi.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index 7febb8a6..4ce08825 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -1369,9 +1369,13 @@ class IpmiHandler(object): def handle_sysconfig(self, advanced=False): if 'read' == self.op: - self.output.put(msg.ConfigSet( - self.node, self.ipmicmd.get_system_configuration( - hideadvanced=not advanced))) + try: + self.output.put(msg.ConfigSet( + self.node, self.ipmicmd.get_system_configuration( + hideadvanced=not advanced))) + except Exception as e: + self.output.put( + msg.ConfluentNodeError(self.node, str(e))) elif 'update' == self.op: self.ipmicmd.set_system_configuration( self.inputdata.get_attributes(self.node))