Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[automation] Fully synchronize script action/condition execution if supported by engine #4426

Merged

Conversation

florian-h05
Copy link
Contributor

@florian-h05 florian-h05 commented Oct 26, 2024

If the ScriptEngine implements Lock, synchronize the execution of script action/condition.
In contrast to #4402, this now synchronizes the full script context access, which setup of execution context, script evaluation and reset of execution context, and not only the script evaluation.

It moves the locking mechanism added in #4402 from AbstractScriptModuleHandler to the inheritors of AbstractScriptModuleHandler.

This fixes the bug that openhab/openhab-addons#17510 worked around by using Thread.sleep.

…implements Lock

This moves the locking mechanism added in openhab#4402 to the inheritors of AbstractScriptModuleHandler
to synchronize execution context access as well.

This fixes the problem thathttps://github.com/openhab/openhab-addons/pull/17510 worked around by using Thread.sleep.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
@florian-h05 florian-h05 requested a review from a team as a code owner October 26, 2024 11:44
@florian-h05 florian-h05 changed the title [automation] Fully synchronize script action/condition execution if required [automation] Fully synchronize script action/condition execution if supported by engine Oct 26, 2024
florian-h05 added a commit to florian-h05/openhab-addons that referenced this pull request Oct 26, 2024
…es with UI-based scripts

Follow-up for openhab#1710.
Depends on openhab/openhab-core#4426.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
@florian-h05
Copy link
Contributor Author

openhab/openhab-addons#17630 can be merged after this PR here has been merged.

Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@kaikreuzer kaikreuzer merged commit 922a206 into openhab:main Oct 26, 2024
5 checks passed
@kaikreuzer kaikreuzer added the bug An unexpected problem or unintended behavior of the Core label Oct 26, 2024
@kaikreuzer kaikreuzer added this to the 4.3 milestone Oct 26, 2024
kaikreuzer pushed a commit to openhab/openhab-addons that referenced this pull request Oct 26, 2024
…es with UI-based scripts (#17630)

Follow-up for #1710.
Depends on openhab/openhab-core#4426.

Signed-off-by: Florian Hotze <dev@florianhotze.com>
@florian-h05 florian-h05 deleted the scriptmodule-synchronize-multithread branch October 26, 2024 21:42
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.

2 participants