Skip to content

Commit ff8e496

Browse files
authored
Improve events docs (#857)
1 parent ab7ccf6 commit ff8e496

File tree

2 files changed

+46
-30
lines changed

2 files changed

+46
-30
lines changed

src/user-guide/writing-workflows/runtime.rst

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -653,14 +653,14 @@ as complete (and with the ``--flow`` option, if needed to make a specific
653653
Task Event Handling
654654
-------------------
655655

656-
Task event handlers allow configured commands to run when task events occur.
656+
Task event handlers allow configured commands to run when task events occur,
657+
e.g. ``submitted`` and ``failed``.
657658

658-
.. note::
659-
660-
Cylc supports workflow events e.g. ``startup`` and ``shutdown``
661-
and task events e.g. ``submitted`` and ``failed``.
659+
.. admonition:: Not to be confused with
660+
:class: tip
662661

663-
See also :ref:`user_guide.scheduler.workflow_event_handling`.
662+
For *workflow* events, e.g. ``startup`` and ``shutdown``, see
663+
:ref:`user_guide.scheduler.workflow_event_handling`.
664664

665665
Event handlers can be used to send a message, raise an alarm, or whatever you
666666
like. They can even call ``cylc`` commands to intervene in the workflow.
@@ -679,42 +679,53 @@ Event handlers can be stored in the workflow ``bin`` directory, or anywhere in
679679
They should return quickly to avoid tying up the scheduler process pool -
680680
see :ref:`Managing External Command Execution`.
681681

682+
.. _user_guide.runtime.task_event_handling.list:
682683

683-
.. _user_guide.runtime.task_event_handling.event_specific_handlers:
684-
685-
Event-Specific Handlers
686-
^^^^^^^^^^^^^^^^^^^^^^^
684+
List Of Task Events
685+
^^^^^^^^^^^^^^^^^^^
687686

688-
Event-specific handlers are configured by ``<event> handlers``
689-
under :cylc:conf:`[runtime][<namespace>][events]`, where ``<event>``
690-
can be:
687+
.. cylc-scope:: flow.cylc[runtime][<namespace>]
691688

692689
.. |br| raw:: html
693690

694691
<br>
695692

696-
697693
.. table::
698694

699695
========================================= ================================
700696
Event Description
701697
========================================= ================================
702698
submitted job submitted
703-
submission retry job submission failed but will retry later
704-
submission failed job submission failed
699+
submission retry job submission failed but will retry after the configured :cylc:conf:`submission retry delays`
700+
submission failed job submission failed and no retries are configured or remaining
705701
started job started running
706-
retry job failed but will retry later
707-
failed job failed
702+
retry job failed but will retry after the configured :cylc:conf:`execution retry delays`
703+
failed job failed and no retries are configured or remaining
708704
succeeded job succeeded
709-
submission timeout job timed out in the ``submitted`` state
710-
execution timeout job timed out in the ``running`` state
705+
submission timeout job exceeded the :cylc:conf:`[events]submission timeout` while in the ``submitted`` state
706+
execution timeout job exceeded the :cylc:conf:`[events]execution timeout` while in the ``running`` state
711707
warning scheduler received a message of severity WARNING from job
712708
critical scheduler received a message of severity CRITICAL from job
713709
custom scheduler received a message of severity CUSTOM from job |br| (note: literally, the word ``CUSTOM``)
714710
expired task expired and will not submit (too far behind)
715711
late task running later than expected
716712
========================================= ================================
717713

714+
Any of a task's :term:`custom outputs <custom output>` are also valid event
715+
names.
716+
717+
.. cylc-scope::
718+
719+
720+
.. _user_guide.runtime.task_event_handling.event_specific_handlers:
721+
722+
Event-Specific Handlers
723+
^^^^^^^^^^^^^^^^^^^^^^^
724+
725+
Event-specific handlers are configured by ``<event> handlers``
726+
under :cylc:conf:`[runtime][<namespace>][events]`, where ``<event>``
727+
can be any in the table above.
728+
718729
Values should be a list of commands, command lines, or command line templates
719730
(see below) to call if the specified event is triggered.
720731

@@ -730,8 +741,8 @@ Alternatively you can configure a list of generic event :cylc:conf:`handlers` to
730741
for configured :cylc:conf:`handler events`.
731742

732743
:cylc:conf:`handler events`
733-
A list of events which may include any of the above
734-
events (e.g. ``submission failed`` or ``warning``) or
744+
A list of events which may include any of the events in the table above
745+
(e.g. ``submission failed`` or ``warning``) or
735746
any of a task's :term:`custom outputs <custom output>`.
736747
:cylc:conf:`handlers`
737748
A list of commands to be run for these events.

src/user-guide/writing-workflows/scheduler.rst

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ workflows.
1515
Workflow Events
1616
---------------
1717

18-
There are two types of event in Cylc:
18+
Workflow events, e.g. ``startup`` and ``shutdown``, pertain to the
19+
:term:`scheduler`.
1920

20-
* workflow events e.g. ``startup`` and ``shutdown``, which pertain to the :term:`scheduler`
21-
* task events e.g. ``submitted`` and ``failed``, which pertain to :term:`tasks <task>`.
21+
.. admonition:: Not to be confused with
22+
:class: tip
2223

23-
This section covers workflow events, for
24-
task events see :ref:`user_guide.runtime.task_event_handling`.
24+
For :term:`task` events, e.g. ``submitted`` and ``failed``, see
25+
:ref:`user_guide.runtime.task_event_handling`.
2526

2627
.. rubric:: Event Handlers
2728

@@ -33,15 +34,19 @@ run when workflow events occur. These can be configured by:
3334

3435
.. rubric:: Abort On Event
3536

36-
As well as event handlers, you can tell the scheduler to abort (i.e., shut down
37-
immediately with error status) on certain workflow events, using the
37+
As well as event handlers, you can tell the scheduler to shut down
38+
immediately (with error status) on certain workflow events, using the
3839
``abort on ...`` configurations.
3940

4041
.. rubric:: Configuration
4142

4243
Some workflow events have related configurations e.g. for setting the timeout.
4344

44-
.. rubric:: List of workflow events:
45+
46+
.. _user_guide.scheduler.workflow_events.list:
47+
48+
List of workflow events
49+
^^^^^^^^^^^^^^^^^^^^^^^
4550

4651
.. cylc-scope:: global.cylc[scheduler][events]
4752

0 commit comments

Comments
 (0)