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):
def __init__(self, config):
super().__init__()
self.daemon = True
self.config = config

View File

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

View File

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

View File

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

View File

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

View File

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