Skip to content
Snippets Groups Projects
Commit 3f28d699 authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-271: Moved from deprecated isAlive to is_alive when using threading.Thread.

parent 2a39e2a8
No related branches found
No related tags found
1 merge request!85L2SS-271: Split statistics base classes off SSTs, cleaned those classes up a bit
......@@ -60,10 +60,10 @@ class StatisticsClient(CommClient):
return super().connect()
def ping(self):
if not self.statistics.isAlive():
if not self.statistics.is_alive():
raise Exception("Statistics processing thread died unexpectedly")
if not self.udp.isAlive():
if not self.udp.is_alive():
raise Exception("UDP thread died unexpectedly")
def disconnect(self):
......
......@@ -81,7 +81,7 @@ class UDPReceiver(Thread):
super().join(timeout)
if self.isAlive():
if self.is_alive():
# happens if timeout is hit
return
......@@ -89,13 +89,13 @@ class UDPReceiver(Thread):
self.sock.shutdown(socket.SHUT_RDWR)
def disconnect(self):
if not self.isAlive():
if not self.is_alive():
return
# try to get the thread shutdown, but don't stall forever
self.join(self.DISCONNECT_TIMEOUT)
if self.isAlive():
if self.is_alive():
# there is nothing we can do except wait (stall) longer, which could be indefinitely.
logger.error(f"UDP thread for {self.host}:{self.port} did not shut down after {self.DISCONNECT_TIMEOUT} seconds, just leaving it dangling. Please attach a debugger to thread ID {self.ident}.")
......
......@@ -67,13 +67,13 @@ class StatisticsCollector(Thread):
super().join(timeout)
def disconnect(self):
if not self.isAlive():
if not self.is_alive():
return
# try to get the thread shutdown, but don't stall forever
self.join(self.DISCONNECT_TIMEOUT)
if self.isAlive:
if self.is_alive():
# there is nothing we can do except wait (stall) longer, which could be indefinitely.
logger.error(f"Statistics thread did not shut down after {self.DISCONNECT_TIMEOUT} seconds, just leaving it dangling. Please attach a debugger to thread ID {self.ident}.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment