mirror of https://git.48k.eu/ogclient
#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
parent
cc0d98786d
commit
e549bd819e
|
@ -100,6 +100,7 @@ class ogClient:
|
|||
|
||||
if len(data) == 0:
|
||||
self.sock.close()
|
||||
self.ogrest.kill_process()
|
||||
self.connect()
|
||||
return
|
||||
|
||||
|
|
Loading…
Reference in New Issue