[BUG REPORT] Periodic Rule runs multiple instances RM 5.1

Hub details

Rule triggers

First day things are fine. After midnight two instances are scheduled every 15 minutes.
Log: see two instances run every 15 minutes

Scheduled jobs; two instances scheduled

On successive days, I have seen 3,4,5 or more instances scheduled and running.

I'll take a look at the RM side of this. This might take a few days given the failure shows up in days.

Update: This may be easier than I thought. In fact, I think I know what/where the bug is (and it is a bug!).

The problem arises whenever there are sunrise/sunset triggers and periodic triggers in the same rule. Right after midnight each night, the rule is mistakenly rescheduling the periodic trigger, creating the multiple triggers problem, when it should only be rescheduling sunrise/sunset related triggers to run that day.

A simple interim workaround is to move the periodic trigger to a rule by itself that runs the actions of the rule you have now.

4 Likes

Thanks for the quick reply! I noticed this happened several days ago, but I finally went through the logs to see when the "extra" iteration of the rule started.

I've got to let this run over the weekend to see if all is good with a simple fix. If so, the fix will be in Release 2.4.0, yet to go to beta.

4 Likes

Update: Overnight, it went from 2 to 4 instances every 15 minutes. Note there are TWO sets of Scheduled:Sunrise and Scheduled:Sunset entries in the log right after midnight this time, The two sets are about 18 seconds apart.

Show the Scheduled Jobs section (bottom of page) for the rule from its App Status page (gear icon).

I updated the rule yesterday evening. I changed the rule to stop sending notifications to my phone. So it was back to running once every 15 minutes as expected for awhile.

Here is the log for only this rule, from around 10pm last night. There are only 3 lines each time this rule runs (it's a stub rule only for testing). But somehow at 10:15pm and thereafter, it ran twice (see 6 log events) every 15 minutes.

Then, just after midnight it changed to running 3 instances every 15 minutes (again 3 log lines per instance, 9 lines total; and 3 "Event: Triggered by Periodic Schedule" lines each time.

Here is the current Scheduled Jobs section from the rule showing 3 scheduled:

Here is the Scheduled Jobs page showing 3 instances scheduled:

Yeah, this is all expected. Fix will be in the 2.4.0 release.

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.