From 2c78ee9fa3998d536ada56f9b4db4c571388c110 Mon Sep 17 00:00:00 2001 From: Jon Holba Date: Fri, 1 Nov 2024 14:08:42 +0100 Subject: [PATCH] Make scheduler execute yield during spawning of realizations Starting the realizations in scheduler was blocking all other async tasks from running. Nothing could connect to ensemble evaluator during this. Under heavy load this could cause Monitor to time out and fail. Now we will sleep(0) between each time we create a new subprocess. This will allow other asyncio tasks to run. --- src/ert/scheduler/scheduler.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ert/scheduler/scheduler.py b/src/ert/scheduler/scheduler.py index 8227b8395f7..0ce7fc1b3dc 100644 --- a/src/ert/scheduler/scheduler.py +++ b/src/ert/scheduler/scheduler.py @@ -276,6 +276,7 @@ async def execute( # does internalization at a time forward_model_ok_lock = asyncio.Lock() for iens, job in self._jobs.items(): + await asyncio.sleep(0) if job.state != JobState.ABORTED: self._job_tasks[iens] = asyncio.create_task( job.run(sem, forward_model_ok_lock, self._max_submit),