From a8e1d0e1e899852ef40479325c10a3f6a914607e Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Thu, 29 Jun 2023 11:27:28 +0200 Subject: [PATCH] frappy_psi.sea: try to reconnect on failure both .asynio and .syncio connection should be tried to reopen. (fix from mlz gerrit) Change-Id: I0da5bd9927865a1c55afb93a7a5b76c44fc8750e --- frappy_psi/sea.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frappy_psi/sea.py b/frappy_psi/sea.py index c437a4e..bf294f7 100644 --- a/frappy_psi/sea.py +++ b/frappy_psi/sea.py @@ -227,6 +227,10 @@ class SeaClient(ProxyClient, Module): else: result.append(reply) except ConnectionClosed: + try: + self.syncio.disconnect() + except Exception: + pass self.syncio = None raise TimeoutError('no response within 10s') @@ -238,9 +242,10 @@ class SeaClient(ProxyClient, Module): continue except ConnectionClosed: try: - self.asynio.close() + self.asynio.disconnect() except Exception: - self.asynio = None + pass + self.asynio = None break try: msg = json.loads(reply)