summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOpenGnSys Support Team <soporte-og@soleta.eu>2021-11-10 14:26:20 +0100
committerJavier Sánchez Parra <jsanchez@soleta.eu>2021-11-11 13:12:45 +0100
commite549bd819ead5e66b3b0f86592b41399c62460eb (patch)
tree7d933ce5ef527ffcdbf9b3403ed192c5b448ae85 /src
parentcc0d98786dbeefb944032ad4afc7bb65ebb074bc (diff)
#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.
Diffstat (limited to 'src')
-rw-r--r--src/ogClient.py1
1 files changed, 1 insertions, 0 deletions
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