From 797465b3eb41a8a6d89595b1bd8dc166232dd2dd Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 24 Aug 2021 15:50:03 -0400 Subject: [PATCH] Handle some intra-collective errors better --- confluent_server/confluent/core.py | 6 +++--- confluent_server/confluent/sockapi.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/confluent_server/confluent/core.py b/confluent_server/confluent/core.py index 966dd3a6..32511cf8 100644 --- a/confluent_server/confluent/core.py +++ b/confluent_server/confluent/core.py @@ -1054,12 +1054,12 @@ def dispatch_request(nodes, manager, element, configmanager, inputdata, remote = ssl.wrap_socket(remote, cert_reqs=ssl.CERT_NONE, keyfile='/etc/confluent/privkey.pem', certfile='/etc/confluent/srvcert.pem') - except Exception: + except Exception as e: for node in nodes: if a: yield msg.ConfluentResourceUnavailable( - node, 'Collective member {0} is unreachable'.format( - a['name'])) + node, 'Collective member {0} is unreachable ({1})'.format( + a['name'], str(e))) else: yield msg.ConfluentResourceUnavailable( node, diff --git a/confluent_server/confluent/sockapi.py b/confluent_server/confluent/sockapi.py index 4172313c..971c1738 100644 --- a/confluent_server/confluent/sockapi.py +++ b/confluent_server/confluent/sockapi.py @@ -205,7 +205,8 @@ def sessionhdl(connection, authname, skipauth=False, cert=None): except Exception: request = None finally: - cfm.close_client_files() + if cfm: + cfm.close_client_files() try: connection.close() except Exception: