added timeouts for joining threads so that the system will not

hang forever if some thread does not join
pull/783/head
Madis Kaal 2023-07-03 16:45:44 +03:00
rodzic 40926abad9
commit 16acef5d2c
1 zmienionych plików z 9 dodań i 3 usunięć

Wyświetl plik

@ -759,13 +759,19 @@ class APRSUploader(object):
# Wait for all threads to close.
if self.upload_thread is not None:
self.upload_thread.join()
self.upload_thread.join(60)
if self.upload_thread.is_alive():
self.log_error("aprs upload thread failed to join")
if self.timer_thread is not None:
self.timer_thread.join()
self.timer_thread.join(60)
if self.timer_thread.is_alive():
self.log_error("aprs timer thread failed to join")
if self.input_thread is not None:
self.input_thread.join()
self.input_thread.join(60)
if self.input_thread.is_alive():
self.log_error("aprs input thread failed to join")
def log_debug(self, line):
""" Helper function to log a debug message with a descriptive heading.