Skip to content

[automation] Skip pre-compilation if rule engine not yet started - #5001

Merged
holgerfriedrich merged 1 commit into
openhab:mainfrom
florian-h05:precompile
Sep 7, 2025
Merged

[automation] Skip pre-compilation if rule engine not yet started#5001
holgerfriedrich merged 1 commit into
openhab:mainfrom
florian-h05:precompile

Conversation

@florian-h05

Copy link
Copy Markdown
Contributor

Closes #4965.

As the rule engine needs to be started for the system to reach start level 40 and automation add-ons are not loaded before start level 80, skip pre-compilation if rule engine not yet started as automation add-ons are not available yet.

Closes openhab#4965.

As the rule engine needs to be started for the system to reach start level 40 and automation add-ons are not loaded before start level 80,
skip pre-compilation if rule engine not yet started as automation add-ons are not available yet.

Since the rule engine does not start

Signed-off-by: Florian Hotze <dev@florianhotze.com>
@holgerfriedrich

Copy link
Copy Markdown
Member

Just to give me some context, how will the rule compilation be triggerd, as it fails during activation of the rule?
Does it rely on onReadyMarkerAdded calling compileRules?

@holgerfriedrich holgerfriedrich added the bug An unexpected problem or unintended behavior of the Core label Sep 7, 2025
@florian-h05

Copy link
Copy Markdown
Contributor Author

Does it rely on onReadyMarkerAdded calling compileRules?

Exactly, this will trigger compilation of all rules on startup. Normally automation engines are available when the ready marker that registration is done for in the constructor of the RuleEngineIm is added.
If a rule is added later, it will be compiled through the activateRule method call.

@holgerfriedrich holgerfriedrich left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the explanation

@holgerfriedrich
holgerfriedrich merged commit dc48fb8 into openhab:main Sep 7, 2025
5 checks passed
@holgerfriedrich holgerfriedrich added this to the 5.1 milestone Sep 7, 2025
@florian-h05
florian-h05 deleted the precompile branch September 7, 2025 15:37
@lolodomo

lolodomo commented Sep 8, 2025

Copy link
Copy Markdown
Contributor

@florian-h05 I guess it should be backported to 5.0.x and then t can be without any risk?

@florian-h05

Copy link
Copy Markdown
Contributor Author

No need to backport, as the false alarm error logs were already fixed by #4971.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An unexpected problem or unintended behavior of the Core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ScriptEngineManagerImpl invoked too early in the startup process

3 participants