Can I reset an xtrigger?

I know that xtrigger valus are stored in the suite log database - is there a way to “reset” an xtrigger for the following workflow I’ve concocted by way of illustration:

  1. Task "consume in suite “foo” depends only on an xtrigger that checks on the availability of file “F”
  2. File “F” is produced by a task “produce” in suite “bar”
  3. A problem occurs (disk filled up, so file present but with incomplete output
  4. task “consume” and several tasks upstream of “consume” need to be re-run
  5. task “consume” in suite “foo” is reset to waiting[*]
  6. task “produce” in suite “bar” is re-triggered to rewrite file “F”

At this point, because the xtrigger was already satisfied, task “consume” in suite “foo” should fire again, but in this case too early because task “produce” in suite “bar” hasn’t finished yet and the xtrigger is picking up the production of file “F” from the last time around, not the current execution. What I think I want to do is reset/clear the xtrigger dependence, forcing the trigger function to execute again as the task is waiting until the file is reproduced successfully and the run can pick up where it left off.

How would I accomplish this? I didn’t see this in the documentation, but I was reading quickly.

Hi Tim,

Good question!

Currently xtriggers cannot be unset, but there is a somewhat ugly workaround.

  • First try to arrange it so that this should not be necessary! E.g. in your contrived example, the xtrigger should check that the externally-generated file is complete and valid, not just present.

  • But if you really need to do it, here’s how: xtrigger calls are uniquely identified and tracked (by Cylc) by function signature, i.e. the complete ordered list of arguments and their values. So, you can add a dummy argument to the xtrigger function, force_retry say, that is not used inside the function, but if you increment the value passed in from the suite definition, then reload the suite, the xtrigger will then be new and unsatisfied, and so Cylc will start calling it again until it is satisfied.

(I know I originally intended to allow explicit xtrigger reset, which would obviously be better than this, but it seems to have dropped off the radar … I’ll post an Issue)

Thanks! Agree that in this contrived example the solution you outline (i.e. checking validity) is the right way to handle it.

I’ll keep an eye on the issue.

To clarify - the workaround requires the suite be reloaded to increment the value, correct? i.e. this wouldn’t be able to be done straight from the GUI.

Yes it does require a) editing the suite definition; and b) reloading it (i.e., for the benefit of others, telling the running suite server program to re-parse the suite definition and absorb any changes).

However, you can do a reload from the GUI - it’s under the Control menu.