cylc-flow
cylc-flow copied to clipboard
Jinja2 set value where script exits nonzero but doesn't raise
Description
If Jinja2 tries to set a value equal to a script and the script exits non-zero but does not raise an exception the non-daemonized fork of the scheduler remains active and difficult to kill (requires -9).
Reproducible Example
#!jinja2
# flow.cylc
{% from "sys" import exit %}
{% set KEY = exit() %}
cylc install
cylc play <workflow>
Will leave you with at least one workflow process requring kill -9 to kill.
Expected Behaviour
Failure of this sort should kill both forks.
The Jinja2 template.render() operation seems to hang for cylc play -N but not for cylc validate. Not sure why!
Easy to workaround, use raise Exception not sys.exit in your Jinja2 codes!
Unlikely to crop up again, so a reasonably low priority.