diff --git a/SAS/TMSS/backend/services/lobster/lib/message_handler.py b/SAS/TMSS/backend/services/lobster/lib/message_handler.py index 0d97549b72e6da7b37f859bf9935a12410905b0b..100c8a74f81544cda2f21708d2cb3c776adb6f47 100644 --- a/SAS/TMSS/backend/services/lobster/lib/message_handler.py +++ b/SAS/TMSS/backend/services/lobster/lib/message_handler.py @@ -45,7 +45,30 @@ import logging logger = logging.getLogger(__name__) -LOOK_AHEAD_WINDOW = timedelta(minutes=3) +# Every POLL_INTERVAL, look LOOK_AHEAD_WINDOW ahead and start any observation +# in scheduled state with a start_time within the window. This immediately +# triggers a subtask state transition to queueing/queued/starting/started +# (so at ~t-180s). +# +# For observations involving LOFAR1 stations, MACScheduler will poll +# every pollIntervalPlanned (5s) and looks QueuePeriod (3min) ahead. It +# will start processing any observation in scheduled state wit a start_time +# within the window: +# * It will generate the parset +# * It will start claiming resources for the observation in PVSS +# * The next poll, it will start any observation still in scheduled state +# for which the resources are claimed +# * Started observations will result in ObservationControl, which will +# report back that it is ready (~t-80s) and active (~t+1s), resulting +# in MACScheduler posting state transitions to queuing/queued and +# starting/started, respectively. +# +# For LOFAR1+2 combined observations, both LOBSTER and MACScheduler run +# in parallel. To make sure everything keeps working, we let MACScheduler +# act first, since it will force state transitions late (t-80s). With +# a LOOK_AHEAD_WINDOW of 2 minutes, MACScheduler will have triggered the +# ObservationControl, but the subtask is still in scheduled state. +LOOK_AHEAD_WINDOW = timedelta(minutes=2) POLL_INTERVAL = timedelta(seconds=15)