Skip to content

Commit

Permalink
scheduler: write contact file before configure
Browse files Browse the repository at this point in the history
* Write the contact file earlier to minimise the window of opportunity
  for two schedulers to start up for the same workflow.
  • Loading branch information
oliver-sanders committed Jun 28, 2023
1 parent 4d66301 commit 0aadc90
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cylc/flow/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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:
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:
Expand Down

0 comments on commit 0aadc90

Please sign in to comment.