Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Lock mechanism for forward_model_ok #8566

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/ert/scheduler/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ async def run(self, sem: asyncio.BoundedSemaphore, max_submit: int = 1) -> None:
if self.returncode.result() == 0:
if self._scheduler._manifest_queue is not None:
await self._verify_checksum()
await self._handle_finished_forward_model()
async with self._scheduler._forward_model_ok_lock:
await self._handle_finished_forward_model()
break

if attempt < max_submit - 1:
Expand Down
4 changes: 4 additions & 0 deletions src/ert/scheduler/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ def __init__(
self._completed_jobs_num: int = 0
self.completed_jobs: asyncio.Queue[int] = asyncio.Queue()

# this lock is to assure that no more than 1 task
# does internalization at a time
self._forward_model_ok_lock: asyncio.Lock = asyncio.Lock()

self._cancelled = False
if max_submit < 0:
raise ValueError(
Expand Down