From 1eb65a77909cece21a0d8e7610213995887dbea1 Mon Sep 17 00:00:00 2001 From: Klaas van Schelven Date: Fri, 5 Jul 2024 15:58:15 +0200 Subject: [PATCH] Release worker_semaphore when failing to create worker exposed when playing around with arbitrary Tasks in a shell; this created workers I could not run, which would put the foreman in a 'waiting for available threads' mode. I briefly looked at the rest of that loop to see whether more exception handling is necessary, but TBH I don't think we can reasonably recover from e.g. task.delete() failing (or at least I don't want to think about it now) --- snappea/foreman.py | 1 + 1 file changed, 1 insertion(+) diff --git a/snappea/foreman.py b/snappea/foreman.py index 3f3ff85..ca46366 100644 --- a/snappea/foreman.py +++ b/snappea/foreman.py @@ -296,6 +296,7 @@ class Foreman: with time_to_logger(performance_logger, "Snappea delete Task"): task.delete() # we delete the task because we can't do anything with it, and we don't want to hang capture_exception(e) + self.worker_semaphore.release() continue self.check_for_stopping() # check_for_stopping() right before taking on the work