Behaviour change from OH 2.4 to OH 2.5.8?

Dear all,

I want to thank you for the great work about OH 2.5. To reinclude a lot of stuff from eclipse looks very fine.

But I discovered some behaviour changes from OH 2.4 to OH 2.5.8

  1. In OH 2.4 only the running timer in the rule which is reloaded are crashing if they are run to end before reload (totally clear, because timer variables are recreated by reload of rule). In OH 2.5.8 it looks like all timers in all rules are effected not only the times in the reloaded rule?
  2. It looks like the rule engine is a little but more instable in OH 2.5.8. If I change/reload rules more then 20 times at the runtime of OH (I mean changing rules over a period of 1 to 10 days) the rule engine will stop to reload changed rule files. I have to restart rule runtime binding via console to get it back to work. Is this a known problem?
  3. In Visual Studio code I get sometimes the message, that the .rules-file which is open is no longer accessable. I have to close and reopen it, to solve it.
  4. It looks like the sequence of loading add-ons (bindings) and .rules file is different. .rules got loaded before bindings are fully loaded. This causes problems in my rules which uses pushbullet or mail action. I use this code:
val mailActions = getActions("mail","mail:smtp:samplesmtp")

rule "Test mail"
Item Test is changed
mailActions.sendHtmlMail("", "Test subject", "This is the mail content.")

At start of OH and after load of rule file the log tells me, that this cannot be done

val mailActions = getActions("mail","mail:smtp:samplesmtp")

due to not loaded binding. To avoid this I put the line into every rule instead on top of the rule file outside of the rules.

It should generate an error for all running Timers that were created in that .rules file. It’s been well over a year since I’ve looked at 2.4 so I can’t say for sure, but I believe that was the case then too.

This is the first I’ve seen it reported. Normally I’d say create an issue but OH 2.5 core is frozen and all new work is being done on OH 3 So you’s have to load the OH 3 snapshot and see if the same behavior is still there. There are lots of changes to how rules are loaded and a new rules engine so I’d be surprised if this would still be a problem. And it’s an exceedingly rare problem given it’s never been reported in the more than a year and half since 2.4 was released. What’s the CPU doing when it stops being loading rules?

The sequence has always been undefined. If it’s always loaded properly for you it’s largely a matter of luck, and your luck has run out. This is an issue that has been well known and well discussed since OH 2.0 came out. Note, when using the NGRE this is not a problem. Rules do not load until everything else is loaded.

As far as I’m aware, this has always been required for Actions connected to Things (i.e. not the old style 1.x Actions).

If I were to guess, this is the root of problem 2. Every time there is a file event OH is going to try and reload that file. On an RPi loading .rules files can take quite some time and consume lots of CPU. And OH queues up the changes so if any file (even the same one) changes three times there will be a ful reload three times. It becomes very easy to end up in a case where you’ve starved the machine of CPU and the rules just wont run because OH is stuck in a reload loop.

Alternatively, this could be a symptom of a bad network connection between VSCode and your OH. Are you using Remote SSH or editing through a SAMBA share?

Thanks for your reply. I didn’t had all that problems on OH 2.4. Nothing has changed on my side, only OH update to 2.5.8.

There is another post where the rules-engine problem is discussed:

I’m on windows, no samba and no ssh neeeded. Directly edit conf-files on local machine via VSC.

I think you are right. It has something to do with VSC and how OH 2.5.8 handles config-files changes. It looks like there is a difference here.

But as you said, no bug fixing any longer on OH 2.5.x. I have to live with it or go back to OH2.4 which was very stables since a year now.

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