From 90d11ec9604f2d3b4b2a12cd90ba19ec58fbf1ca 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 9fbc2595ba9..60939796c3a 100644 --- a/src/ert/scheduler/scheduler.py +++ b/src/ert/scheduler/scheduler.py @@ -277,6 +277,7 @@ async def execute( forward_model_ok_lock = asyncio.Lock() verify_checksum_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(