diff --git a/sisyphus/engine.py b/sisyphus/engine.py index e753ef1..7d367a7 100644 --- a/sisyphus/engine.py +++ b/sisyphus/engine.py @@ -124,7 +124,6 @@ def get_job_used_resources(self, current_process): This function should only be used by the worker. :param psutil.Process current_process: - :param engine_selector: """ d = {} diff --git a/sisyphus/worker.py b/sisyphus/worker.py index 6fa51e3..a1cd942 100644 --- a/sisyphus/worker.py +++ b/sisyphus/worker.py @@ -1,3 +1,4 @@ +from typing import Optional import gzip import logging import os @@ -12,6 +13,7 @@ import time from threading import Thread, Condition +import sisyphus import sisyphus.global_settings as gs import sisyphus.job_path import sisyphus.toolkit @@ -57,7 +59,7 @@ def __init__(self, job, task, task_id): self.task = task self.task_id = task_id self.start_time = None - super().__init__(daemon=True) + super().__init__(daemon=True, name="LoggingThread") self.out_of_memory = False self._cond = Condition() self.__stop = False @@ -223,7 +225,7 @@ def worker_helper(args): path.cached = False # find task - task = None + task: Optional[sisyphus.Task] = None for task_check in job._sis_tasks(): if task_check.name() == args.task_name: task = task_check @@ -240,6 +242,10 @@ def worker_helper(args): logging_thread = LoggingThread(job, task, task_id) logging_thread.start() + # TODO init hang detection thread here... + # based on task.running(task_id), which causes + # "Job marked as running but logging file has not been updated" warnings when False + sisyphus.job_path.Path.cacheing_enabled = True resume_job = False gs.active_engine.init_worker(task)