#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.
more_events
OpenGnSys Support Team 2021-11-10 14:26:20 +01:00 committed by Javier Sánchez Parra
parent cc0d98786d
commit e549bd819e
1 changed files with 1 additions and 0 deletions

View File

@ -100,6 +100,7 @@ class ogClient:
if len(data) == 0:
self.sock.close()
self.ogrest.kill_process()
self.connect()
return