Current OH2 Build and Thread::sleep() stops ALL rule execution?

Hi,

since many many months I use “Thread::sleep(180000)” in one of my rules.
This worked find until now … but in one of the last builds there seems to be a different behaviour.

Now the whole rule engine seems to “sleep” for that time. Before it was only that single rule that executed the sleep (even if 2 or more rules where in 1 file it affected only that specific rule and not all of them).

Can anyone shed light on me? :frowning:

cheers

Hi shorty707,

Which exact OH build are you using?
I had the same issue some weeks ago.

You can have a look on this thread and the linked github issue

Greetings
Sebastian

hi
currently 1054
I updated very recently because I thought the issue might be fixed … (started some weeks ago)

but also the latest build has this.
you linked thread says there was a fix… does this work for you?

Mh, ok.
For me the fix worked fine.
Any hints in the logs? Have you the chance to try the minimum example from github?

will try that…
but I have a thread sleep for 3min in one specific rule… the system stops all rules for exactly 3 minutes… so I’m 99,9999% sure of a direct relation

Ah, just realized I missed an important point. Has your rule a System started trigger? If not it might be a different issue.

no it gets triggered when my main door opens
i use the sleep then to wait and see if presence detection reports me home or if an alarm should start

Hi All,
after upgrading from OH1.7 to OH2.2 I am also affected by the issue of THREAD::SLEEP() stopping the whole rule engine. I’ve got two rules which slowly ramp up two lights in the sleeping room in the morning. Both rules are running for 20 minutes and are triggered with a 10 minute delay between each other. So the first rule now blocks the second rule and there is no overlap.Instead of total runtime of 30 minutes for both rules it now takes 40 minutes to execute and during that time all other rules are blocked as well.
Strangely two other rules which change the colortemperature of my lighting which are also using THREAD::SLEEP() don’t seem to block the whole engine. Main difference is that these rules are triggered via cron while the ramp-up rules are triggered by a switch item.

I don’t consider using timers instead of THREAD::SLEEP() as a solution because each rule is running for considerable time and takes 100 steps, so each rule would (re)create 100 timers during execution.

Any idea who to fix this issue?

Greetings, Jens

1 Like