Skip to content

Commit a4bba7a

Browse files
brubbeloroulet
authored andcommitted
fix race condition in UASocketClient
1 parent 00a1404 commit a4bba7a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

opcua/client/ua_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def disconnect_socket(self):
150150
self.logger.info("Socket closed, waiting for receiver thread to terminate...")
151151
if self._thread and self._thread.is_alive():
152152
self._thread.join()
153+
self._callbackmap.clear()
153154
self.logger.info("Done closing socket: Receiving thread terminated, socket disconnected")
154155

155156
def send_hello(self, url, max_messagesize=0, max_chunkcount=0):
@@ -190,7 +191,6 @@ def close_secure_channel(self):
190191
with self._lock:
191192
# don't expect any more answers
192193
future.cancel()
193-
self._callbackmap.clear()
194194

195195
# some servers send a response here, most do not ... so we ignore
196196

0 commit comments

Comments
 (0)