From 82dba872eb99f2a130e2e8bef7523bed1aa93e71 Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Fri, 18 Jun 2021 16:05:20 +0000
Subject: [PATCH] L2SS-244: Detect if threads die on us.

---
 devices/clients/sst_client.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/devices/clients/sst_client.py b/devices/clients/sst_client.py
index 8cc80a584..18d17276c 100644
--- a/devices/clients/sst_client.py
+++ b/devices/clients/sst_client.py
@@ -63,6 +63,13 @@ class sst_client(CommClient):
 
         return super().connect()
 
+    def ping(self):
+        if not self.sst.isAlive():
+            raise Exception("SST thread died unexpectedly")
+
+        if not self.udp.isAlive():
+            raise Exception("UDP thread died unexpectedly")
+
     def disconnect(self):
         # explicit disconnect, instead of waiting for the GC to kick in after "del" below
         self.sst.disconnect()
-- 
GitLab