cylc / cylc-flow

Cylc: a workflow engine for cycling systems.
https://cylc.github.io
GNU General Public License v3.0
332 stars 93 forks source link

Repeat events triggered by polling #4415

Open hjoliver opened 3 years ago

hjoliver commented 3 years ago

Polling was designed to update task status where job-to-suite messaging can't be used, or after a network outage that stops messages getting back.

For job status, this works well. If the job is found to have finished, we update its status and stop polling it. Otherwise subsequent polls will just confirm the present status (without retriggering the associated status change event) until it does finish.

However, non status-changing messages in the job.status file will trigger repeat events on every poll, if the associated event is configured.

Example:

[scheduling]
   [[graph]]
      R1 = foo
[runtime]
   [[foo]]
      execution polling intervals = PT10S
      script = "cylc message -p WARNING blarggghhhh && sleep 60"
      [[[events]]]
          warning handlers = "echo !!!! BLARGGGGHHHHHHH"
hjoliver commented 3 years ago

Suggested easy fix: have task proxies maintain a set of received and actioned messages, and check that before triggering message based events.

hjoliver commented 3 years ago

I wonder if anyone actually wants to trigger the same warning event (say) multiple times from the same task by sending the same warning message multiple times. (Of course that would currently create an even worse problem if polled).