-
Notifications
You must be signed in to change notification settings - Fork 94
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
pool: fix infinite loop with --start-cycle-point #5604
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -699,8 +699,8 @@ async def start(self): | |
self.server.thread.start() | ||
barrier.wait() | ||
|
||
await self.configure() | ||
self._configure_contact() | ||
await self.configure() | ||
except (KeyboardInterrupt, asyncio.CancelledError, Exception) as exc: | ||
await self.handle_exception(exc) | ||
|
||
|
@@ -1807,7 +1807,11 @@ async def _shutdown(self, reason: BaseException) -> None: | |
sys.stdout.flush() | ||
sys.stderr.flush() | ||
|
||
if self.contact_data and self.task_job_mgr: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related to the previous, because Test changed to only run when the database is present, which is a better test, as remote-tidy needs database info to function. |
||
if ( | ||
self.workflow_db_mgr.pri_path | ||
and Path(self.workflow_db_mgr.pri_path).exists() | ||
): | ||
# only attempt remote tidy if the workflow has been started | ||
self.task_job_mgr.task_remote_mgr.remote_tidy() | ||
|
||
try: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -312,12 +312,17 @@ def compute_runahead(self, force=False) -> bool: | |
changed (needed if max_future_offset changed, or on reload). | ||
""" | ||
points: List['PointBase'] = [] | ||
sequence_points: Set['PointBase'] | ||
if not self.main_pool: | ||
# Start at first point in each sequence, after the initial point. | ||
points = list({ | ||
seq.get_first_point(self.config.start_point) | ||
for seq in self.config.sequences | ||
}) | ||
points = [ | ||
point | ||
for point in { | ||
seq.get_first_point(self.config.start_point) | ||
for seq in self.config.sequences | ||
} | ||
if point is not None | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem was caused by a |
||
] | ||
else: | ||
# Find the earliest point with unfinished tasks. | ||
for point, itasks in sorted(self.get_tasks_by_point().items()): | ||
|
@@ -793,7 +798,7 @@ def get_hidden_tasks(self) -> List[TaskProxy]: | |
self._hidden_pool_list.extend(list(itask_id_maps.values())) | ||
return self._hidden_pool_list | ||
|
||
def get_tasks_by_point(self): | ||
def get_tasks_by_point(self) -> 'Dict[PointBase, List[TaskProxy]]': | ||
"""Return a map of task proxies by cycle point.""" | ||
point_itasks = {} | ||
for point, itask_id_map in self.main_pool.items(): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated: Swap the order of these two so that the contact file gets written earlier.
This reduces the window of opportunity for two schedulers to start up for the same workflow. Taking a look at the contact file fields, I can't see anything set during
Scheduler.configure
which is used in_configure_contact
so the order should be arbitrary.