diff --git a/cylc/flow/cfgspec/globalcfg.py b/cylc/flow/cfgspec/globalcfg.py index d395f9ed3cc..57b7e0ce4e8 100644 --- a/cylc/flow/cfgspec/globalcfg.py +++ b/cylc/flow/cfgspec/globalcfg.py @@ -101,6 +101,14 @@ desc=''' The number of old run directory trees to retain at start-up. ''') + Conf('auto restart delay', VDR.V_INTERVAL, desc=''' + Relates to Cylc's auto stop-restart mechanism (see + :ref:`auto-stop-restart`). When a host is set to automatically + shutdown/restart it will first wait a random period of time + between zero and ``auto restart delay`` seconds before + beginning the process. This is to prevent large numbers of + suites from restarting simultaneously. + ''') with Conf('run hosts', desc=''' Configure allowed suite hosts and ports for starting up (running or restarting) suites. Additionally configure host selection settings @@ -122,14 +130,6 @@ ``condemned hosts`` they will be automatically shutdown and restarted (see:ref:`auto-stop-restart`). ''') - Conf('auto restart delay', VDR.V_INTERVAL, desc=''' - Relates to Cylc's auto stop-restart mechanism (see - :ref:`auto-stop-restart`). When a host is set to automatically - shutdown/restart it will first wait a random period of time - between zero and ``auto restart delay`` seconds before - beginning the process. This is to prevent large numbers of - suites from restarting simultaneously. - ''') Conf('ranking', VDR.V_STRING, desc=''' A multiline string containing Python expressions to filter and/or rank hosts. For example: diff --git a/cylc/flow/main_loop/auto_restart.py b/cylc/flow/main_loop/auto_restart.py index 811f5bab99e..141255f01b4 100644 --- a/cylc/flow/main_loop/auto_restart.py +++ b/cylc/flow/main_loop/auto_restart.py @@ -27,8 +27,8 @@ .. cylc-scope:: global.cylc - :cylc:conf:`[scheduler]auto restart delay` -- :cylc:conf:`[scheduler]condemned hosts` -- :cylc:conf:`[scheduler]run hosts` +- :cylc:conf:`[scheduler][run hosts]condemned` +- :cylc:conf:`[scheduler][run hosts]available` .. cylc-scope:: global.cylc[scheduler] @@ -57,8 +57,9 @@ .. code-block:: cylc [scheduler] - run hosts = pub - condemned hosts = foo, bar! + [[run hosts]] + available = pub + condemned = foo, bar! .. warning:: @@ -67,9 +68,11 @@ are evaluated on the suite host server. To prevent large numbers of suites attempting to restart simultaneously the -:cylc:conf:`auto restart delay` setting defines a period of time in seconds. +:cylc:conf:`[scheduler]auto restart delay` setting defines a period of time in +seconds. Suites will wait for a random period of time between zero and -:cylc:conf:`auto restart delay` seconds before attempting to stop and restart. +:cylc:conf:`[scheduler]auto restart delay` seconds before attempting to stop +and restart. Suites that are started up in no-detach mode cannot auto stop-restart on a different host - as it will still end up attached to the condemned host. diff --git a/tests/functional/restart/37-auto-restart-delay.t b/tests/functional/restart/37-auto-restart-delay.t index e3bd0b65571..c51bda701b1 100644 --- a/tests/functional/restart/37-auto-restart-delay.t +++ b/tests/functional/restart/37-auto-restart-delay.t @@ -54,9 +54,9 @@ MAX_RESTART_DELAY=30 create_test_global_config '' " ${BASE_GLOBAL_CONFIG} [scheduler] + auto restart delay = PT${MAX_RESTART_DELAY}S [[run hosts]] available = localhost - auto restart delay = PT${MAX_RESTART_DELAY}S " # Run suite. @@ -67,10 +67,10 @@ poll_suite_running create_test_global_config '' " ${BASE_GLOBAL_CONFIG} [scheduler] + auto restart delay = PT20S [[run hosts]] available = ${CYLC_TEST_HOST} condemned = $(hostname) - auto restart delay = PT20S " # Check stop-restart working. diff --git a/tests/functional/restart/43-auto-restart-force-override-normal.t b/tests/functional/restart/43-auto-restart-force-override-normal.t index 4299e245075..cfe1feab43f 100644 --- a/tests/functional/restart/43-auto-restart-force-override-normal.t +++ b/tests/functional/restart/43-auto-restart-force-override-normal.t @@ -63,10 +63,10 @@ FILE=$(cylc cat-log "${SUITE_NAME}" -m p |xargs readlink -f) create_test_global_config '' " ${BASE_GLOBAL_CONFIG} [scheduler] + auto restart delay = -PT60S # results in +PT60S delay [[run hosts]] available = ${CYLC_TEST_HOST_1}, ${CYLC_TEST_HOST_2} condemned = ${CYLC_TEST_HOST_1} - auto restart delay = -PT60S # results in +PT60S delay " log_scan "${TEST_NAME_BASE}-stop" "${FILE}" 40 1 \ 'The Cylc suite host will soon become un-available' \