From e549bd819ead5e66b3b0f86592b41399c62460eb Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Wed, 10 Nov 2021 14:26:20 +0100 Subject: #1056 stop thread if connection with server is lost Abort command if the connection with the server is lost. Otherwise, a race condition that leaves ogServer and ogClient out-of-sync might occur: 1. ogClient is busy running a command (on the worker thread), for example, image/restore. 2. ogServer is stopped OR ogClient loses connection with ogServer (due to transient network problem). 3. ogClient reconnects and ogServer sends a refresh command. 4. ogClient worker thread finishes and it sends a reply to image/restore. 5. ogServer gets confused because it expects a reply to the refresh command, not the old image/restore. --- src/ogClient.py | 1 + 1 file changed, 1 insertion(+) (limited to 'src/ogClient.py') diff --git a/src/ogClient.py b/src/ogClient.py index 3f9ad63..78130fb 100644 --- a/src/ogClient.py +++ b/src/ogClient.py @@ -100,6 +100,7 @@ class ogClient: if len(data) == 0: self.sock.close() + self.ogrest.kill_process() self.connect() return -- cgit v1.2.3-18-g5258