From caa068ad90a3dc9bd71822443f7fc3ce6f42c3a4 Mon Sep 17 00:00:00 2001 From: Tim Pillinger <26465611+wxtim@users.noreply.github.com> Date: Tue, 12 Sep 2023 09:47:54 +0100 Subject: [PATCH] response to review --- cylc/flow/task_events_mgr.py | 2 -- cylc/flow/task_job_mgr.py | 16 ++++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cylc/flow/task_events_mgr.py b/cylc/flow/task_events_mgr.py index 756edf5186c..a33c3ec08db 100644 --- a/cylc/flow/task_events_mgr.py +++ b/cylc/flow/task_events_mgr.py @@ -618,7 +618,6 @@ def process_message( self.setup_event_handlers( itask, self.EVENT_STARTED, f'job {self.EVENT_STARTED}') self.spawn_func(itask, TASK_OUTPUT_STARTED) - if message == self.EVENT_STARTED: if ( flag == self.FLAG_RECEIVED @@ -795,7 +794,6 @@ def _process_message_check( TimerFlags.EXECUTION_RETRY].num > 0 ) ) - ): # Ignore messages if task has a retry lined up # (caused by polling overlapping with task failure) diff --git a/cylc/flow/task_job_mgr.py b/cylc/flow/task_job_mgr.py index 9baa267603f..598a217b4c4 100644 --- a/cylc/flow/task_job_mgr.py +++ b/cylc/flow/task_job_mgr.py @@ -1000,7 +1000,15 @@ def _simulation_submit_task_jobs(self, itasks, workflow): itask.waiting_on_job_prep = False itask.submit_num += 1 self._set_retry_timers(itask) - itask.platform = {'name': 'SIMULATION'} + + # We largely want a clean "platform" and not localhost, + # but we need to get the existing submission retry delays + # to stop _set_retry_delays missing it on retry. + itask.platform = { + 'name': 'SIMULATION', + 'submission retry delays': + itask.platform['submission retry delays'] + } itask.summary['job_runner_name'] = 'SIMULATION' itask.summary[self.KEY_EXECUTE_TIME_LIMIT] = ( itask.tdef.rtconfig['simulation']['simulated run length'] @@ -1008,7 +1016,11 @@ def _simulation_submit_task_jobs(self, itasks, workflow): itask.jobs.append( self.get_simulation_job_conf(itask, workflow) ) - itask.state.status = TASK_STATUS_PREPARING + + # Set status from waiting to preparing to prevent + # _process_message_check returning false because + # state is waiting. + itask.state.status = 'preparing' self.task_events_mgr.process_message( itask, INFO, TASK_OUTPUT_SUBMITTED, )