Skip to content

Commit

Permalink
Ensure that platform from group selection checks broadcast manager
Browse files Browse the repository at this point in the history
for updates to task config.
Ensure that 255 callback gives a sensible platform in warning messages.
  • Loading branch information
wxtim committed Aug 27, 2024
1 parent 347921f commit b0261bd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cylc/flow/subprocpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,12 +557,12 @@ def _run_callback(callback, args_=None):
# Backup, get a platform name from the config:
for arg in callback_args:
if isinstance(arg, TaskProxy):
platform_name = arg.tdef.rtconfig['platform']
platform_name = arg.platform['name']
elif (
isinstance(arg, list)
and isinstance(arg[0], TaskProxy)
):
platform_name = arg[0].tdef.rtconfig['platform']
platform_name = arg[0].platform['name']

if cls.ssh_255_fail(ctx) or cls.rsync_255_fail(ctx, platform) is True:
# Job log retrieval passes a special object as a command key
Expand Down
17 changes: 13 additions & 4 deletions cylc/flow/task_job_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,15 @@ class TaskJobManager:
REMOTE_INIT_IN_PROGRESS: REMOTE_INIT_MSG
}

def __init__(self, workflow, proc_pool, workflow_db_mgr,
task_events_mgr, data_store_mgr, bad_hosts):
def __init__(
self,
workflow,
proc_pool,
workflow_db_mgr,
task_events_mgr,
data_store_mgr,
bad_hosts,
):
self.workflow = workflow
self.proc_pool = proc_pool
self.workflow_db_mgr = workflow_db_mgr
Expand Down Expand Up @@ -306,10 +313,12 @@ def submit_task_jobs(self, workflow, itasks, curve_auth,

# Get another platform, if task config platform is a group
use_next_platform_in_group = False
if itask.tdef.rtconfig['platform']:
bc_mgr = self.task_events_mgr.broadcast_mgr
rtconf = bc_mgr.get_updated_rtconfig(itask)
if rtconf['platform']:
try:
platform = get_platform(
itask.tdef.rtconfig['platform'],
rtconf['platform'],
bad_hosts=self.bad_hosts
)
except PlatformLookupError:
Expand Down

0 comments on commit b0261bd

Please sign in to comment.