Skip to content

Commit fa2a126

Browse files
committed
Data store: fix empty tproxy runtime on reload
1 parent 33ba82d commit fa2a126

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

changes.d/6980.fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed a bug where the GUI views would go blank when reloading a workflow.

cylc/flow/commands.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ async def reload_workflow(schd: 'Scheduler', reload_global: bool = False):
609609
schd.task_job_mgr.task_remote_mgr.remote_init_map.clear()
610610
schd.task_job_mgr.task_remote_mgr.is_reload = True
611611
schd.pool.reload(config)
612+
schd.data_store_mgr.apply_task_proxy_db_history()
612613
# Load jobs from DB
613614
schd.workflow_db_mgr.pri_dao.select_jobs_for_restart(
614615
schd.data_store_mgr.insert_db_job

tests/integration/test_reload.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
from contextlib import suppress
2020

2121
from cylc.flow import commands
22+
from cylc.flow.data_store_mgr import TASK_PROXIES
23+
from cylc.flow.scheduler import Scheduler
2224
from cylc.flow.task_state import (
2325
TASK_STATUS_WAITING,
2426
TASK_STATUS_PREPARING,
@@ -304,3 +306,23 @@ async def test_reload_global_platform_group(
304306
)
305307
platform = get_platform(rtconf)
306308
assert platform['meta']['x'] == '2'
309+
310+
311+
async def test_data_store_tproxy(flow, scheduler, start):
312+
"""Check N>0 task proxy in data store has correct info on reload.
313+
314+
https://github.com/cylc/cylc-flow/issues/6973
315+
"""
316+
schd: Scheduler = scheduler(flow('foo => bar'))
317+
318+
def get_ds_tproxy(task):
319+
return schd.data_store_mgr.data[schd.id][TASK_PROXIES][
320+
f'{schd.id}//1/{task}'
321+
]
322+
323+
async with start(schd):
324+
await schd.update_data_structure()
325+
assert str(get_ds_tproxy('bar').runtime)
326+
327+
await commands.run_cmd(commands.reload_workflow(schd))
328+
assert str(get_ds_tproxy('bar').runtime)

0 commit comments

Comments
 (0)