stop behaviour

This commit is contained in:
Wolfgang Hottgenroth 2021-11-11 16:51:55 +01:00
parent fd0e0e9c71
commit 1f31cfc9dc
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F
6 changed files with 9 additions and 1 deletions

View File

@ -16,6 +16,7 @@ def mqttOnDisconnectCallback(client, userdata, rc):
class AbstractMqttHandler(threading.Thread): class AbstractMqttHandler(threading.Thread):
def __init__(self, config): def __init__(self, config):
super().__init__() super().__init__()
self.daemon = True
self.config = config self.config = config

View File

@ -9,6 +9,8 @@ POISON_PILL = DataObject(name="PoisonPill", topic="kill", payload=None)
class AbstractSinkHandler(threading.Thread): class AbstractSinkHandler(threading.Thread):
def __init__(self, config, name, inQueue, experiment): def __init__(self, config, name, inQueue, experiment):
super().__init__() super().__init__()
self.daemon = True
logger.info("constructor called") logger.info("constructor called")
self.config = config self.config = config

View File

@ -10,6 +10,7 @@ from DataObject import DataObject
class GenericMqttSubscriber(AbstractMqttHandler): class GenericMqttSubscriber(AbstractMqttHandler):
def __init__(self, config, configId, queue): def __init__(self, config, configId, queue):
super().__init__(config) super().__init__(config)
self.name = configId
localConfig = self.config[configId] localConfig = self.config[configId]
self.dataObjectName = localConfig["dataObjectName"] self.dataObjectName = localConfig["dataObjectName"]
self.subscribeTopic = localConfig["topic"] self.subscribeTopic = localConfig["topic"]

View File

@ -26,7 +26,6 @@ class PgDbHandle(object):
if dbPassword == "$ENV$": if dbPassword == "$ENV$":
dbPassword = os.environ["DB_PASSWORD"] dbPassword = os.environ["DB_PASSWORD"]
dbName = self.config["database"]["name"] dbName = self.config["database"]["name"]
logger.info(f"Connect to database") logger.info(f"Connect to database")
self.connInfo = f"user={dbUser} host={dbHost} dbname={dbName} sslmode=require" self.connInfo = f"user={dbUser} host={dbHost} dbname={dbName} sslmode=require"
if dbPassword != "$NONE$": if dbPassword != "$NONE$":

View File

@ -25,6 +25,8 @@ class e_State(Enum):
class RigCmdHandler(threading.Thread): class RigCmdHandler(threading.Thread):
def __init__(self, config, inQueue): def __init__(self, config, inQueue):
super().__init__() super().__init__()
self.daemon = True
self.name = "RigCmdHandler"
self.config = config self.config = config
localConfig = self.config["master"] localConfig = self.config["master"]

View File

@ -69,6 +69,9 @@ rigCmdHandler.stop()
rigCmdHandler.join() rigCmdHandler.join()
logger.error("rigCmdHandler joined") logger.error("rigCmdHandler joined")
for t in threading.enumerate():
logger.error(f"thread still running: {t.ident}, {t.name}")
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
logger.info("IIoTFeeder2 to terminate") logger.info("IIoTFeeder2 to terminate")