From b67367ab216bf56f643bcf444278220c7b84cffb Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Wed, 11 Dec 2024 15:26:48 -0700 Subject: [PATCH 1/3] Update Scheduler addBlock command to allow users to specify how script errors should be handled. --- .../Scheduler/Scheduler_Commands.xml | 8 +++++++ .../Scheduler/Scheduler_Events.xml | 9 ++++++++ python/lsst/ts/xml/enums/Scheduler.py | 21 +++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/python/lsst/ts/xml/data/sal_interfaces/Scheduler/Scheduler_Commands.xml b/python/lsst/ts/xml/data/sal_interfaces/Scheduler/Scheduler_Commands.xml index 780099187..8f7c4baf0 100644 --- a/python/lsst/ts/xml/data/sal_interfaces/Scheduler/Scheduler_Commands.xml +++ b/python/lsst/ts/xml/data/sal_interfaces/Scheduler/Scheduler_Commands.xml @@ -64,6 +64,14 @@ unitless 1 + + failureStrategy + What strategy to employ when there is a script failure? + long + + unitless + 1 + Scheduler diff --git a/python/lsst/ts/xml/data/sal_interfaces/Scheduler/Scheduler_Events.xml b/python/lsst/ts/xml/data/sal_interfaces/Scheduler/Scheduler_Events.xml index d904f5cd3..795668ca0 100644 --- a/python/lsst/ts/xml/data/sal_interfaces/Scheduler/Scheduler_Events.xml +++ b/python/lsst/ts/xml/data/sal_interfaces/Scheduler/Scheduler_Events.xml @@ -1,6 +1,7 @@ + FailureStrategy_NONE,FailureStrategy_ON_SCRIPT_FAILURE,FailureStrategy_KEEP_GOING Scheduler Scheduler_logevent_detailedState @@ -1350,6 +1351,14 @@ unitless 1 + + failureStrategy + Strategy used when there is a script failure. + + long + unitless + 1 + Scheduler diff --git a/python/lsst/ts/xml/enums/Scheduler.py b/python/lsst/ts/xml/enums/Scheduler.py index 4b3d1820a..2f906e873 100644 --- a/python/lsst/ts/xml/enums/Scheduler.py +++ b/python/lsst/ts/xml/enums/Scheduler.py @@ -21,6 +21,7 @@ __all__ = [ "SalIndex", "DetailedState", + "FailureStrategy", ] import enum @@ -54,3 +55,23 @@ class DetailedState(enum.IntEnum): COMPUTING_PREDICTED_SCHEDULE = enum.auto() # Scheduler is queueing targets. QUEUEING_TARGET = enum.auto() + + +class FailureStrategy(enum.IntEnum): + """Strategy to employ when there is a script failure + while executing block. + """ + + # No error recoverable. + # This is the current behavior and causes the Scheduler to remove all + # scripts from the queue and mark the execution as failed. + NONE = enum.auto() + # Will preserve the scripts currently queue and continue to queue them + # if the queue makes progress. If a script is stopped the scheduler will + # cleanup the remaining scripts, stop the block execution and mark it as + # failed. + ON_SCRIPT_FAILURE = enum.auto() + # This will basically instruct the scheduler to ignore any type of error + # or interruption. It will continue to put scripts in the queue until all + # scripts from a block finished. + KEEP_GOING = enum.auto() From 0ff0f662f8794680f2782f09cdb4f4b3075886fe Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Wed, 11 Dec 2024 15:30:33 -0700 Subject: [PATCH 2/3] Update Scheduler event interface to add definition for the DetailedState event. --- .../ts/xml/data/sal_interfaces/Scheduler/Scheduler_Events.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/python/lsst/ts/xml/data/sal_interfaces/Scheduler/Scheduler_Events.xml b/python/lsst/ts/xml/data/sal_interfaces/Scheduler/Scheduler_Events.xml index 795668ca0..71e9e54eb 100644 --- a/python/lsst/ts/xml/data/sal_interfaces/Scheduler/Scheduler_Events.xml +++ b/python/lsst/ts/xml/data/sal_interfaces/Scheduler/Scheduler_Events.xml @@ -1,6 +1,7 @@ + DetailedState_IDLE,DetailedState_RUNNING,DetailedState_WAITING_NEXT_TARGET_TIMER_TASK,DetailedState_GENERATING_TARGET_QUEUE,DetailedState_COMPUTING_PREDICTED_SCHEDULE,DetailedState_QUEUEING_TARGET FailureStrategy_NONE,FailureStrategy_ON_SCRIPT_FAILURE,FailureStrategy_KEEP_GOING Scheduler From c77823983c1776b2b798914b277f79999e40e4a5 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Thu, 12 Dec 2024 08:14:10 -0700 Subject: [PATCH 3/3] Add news fragments. --- doc/news/interface_changes/DM-48100.scheduler.rst | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/news/interface_changes/DM-48100.scheduler.rst diff --git a/doc/news/interface_changes/DM-48100.scheduler.rst b/doc/news/interface_changes/DM-48100.scheduler.rst new file mode 100644 index 000000000..80eefb0e0 --- /dev/null +++ b/doc/news/interface_changes/DM-48100.scheduler.rst @@ -0,0 +1,3 @@ +Add failureStrategy parameter to the addBlock command and blockStatus event. +This parameter allows users to specify how the Scheduler should handle script failures when executing a block. +