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

Script Engines now removed from manager when closed #2706

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

jpg0
Copy link
Contributor

@jpg0 jpg0 commented Jan 24, 2022

Remove script engines from managed once they are closed. It looks like this is a longstanding bug that was only recently uncovered by #2681.

Signed-off-by: Jonathan Gilbert jpg@trillica.com

Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
Copy link
Contributor

@digitaldan digitaldan left a comment

Choose a reason for hiding this comment

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

LGTM , fyi i have tested this on my system and it does indeed solve the issue.

@digitaldan
Copy link
Contributor

I think this is not related to this issue specifically, so should not hold up merging this PR, but @jpg0 scripts are not being loaded when OH starts, and i never see [.rulesupport.loader.ScriptFileWatcher] - Loading script... in the logs. Scripts only load when they are updated/changed after the binding is loaded. (so running touch on a file will load it). I'm not sure if this lives in core or in the addon as i have not started to track it down.

@cweitkamp cweitkamp added automation bug An unexpected problem or unintended behavior of the Core labels Jan 25, 2022
Copy link
Member

@wborn wborn left a comment

Choose a reason for hiding this comment

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

Thanks!

@wborn wborn merged commit 59bc10a into openhab:main Jan 25, 2022
@wborn wborn added this to the 3.3 milestone Jan 25, 2022
@jlaur
Copy link
Contributor

jlaur commented Feb 2, 2022

@jpg0 - do you think this PR with openhab/openhab-addons#12022 is stable and would be worth fixing in a 3.2.x version? In this case we would consider cherry-picking your commits from these two PR's. From the forums, opened issues and my own experience, these bugs seems like showstoppers for actually using jsscripting in 3.2. Please confirm also if you agree to this or not.

@jpg0
Copy link
Contributor Author

jpg0 commented Feb 4, 2022

@jlaur I believe that they're stable, yes. I do remember some interaction with UI rules however though, where script engines are currently re-used - maybe @digitaldan is more across this?

When is 3.3 scheduled to be released? I see that M1 is out and this fix is certainly in that.

@rkoshak
Copy link

rkoshak commented Feb 4, 2022

3.3 should be release around the end of June assuming OH follows the usual release cadence.

@digitaldan
Copy link
Contributor

@jlaur Its a good point, and June does seem like a long time. @wborn @kaikreuzer WDYT about these changes in a 3.2.x patch release? Is that a possibility ?

@jlaur
Copy link
Contributor

jlaur commented Feb 4, 2022

Its a good point, and June does seem like a long time. @wborn @kaikreuzer WDYT about these changes in a 3.2.x patch release? Is that a possibility ?

Exactly. I believe I managed to convince @kaikreuzer as he already created the 3.2.x branch. :) So wanted to confirm with you if you agree that this bug is critical and that the fix is low risk. In this case we can go ahead and cherry-pick the commits into the 3.2.x branch.

@jlaur
Copy link
Contributor

jlaur commented Feb 6, 2022

@digitaldan and @jpg0 - can you confirm that cherry-picking these commits would be safe and fix the issue with jsscripting out of memory issue in 3.2:

@jpg0
Copy link
Contributor Author

jpg0 commented Feb 6, 2022

@digitaldan there is no issue regarding engine reuse for UI scripts related to this is there?

Other than that there is nothing that I'm aware of that would be unsafe in these commits.

@digitaldan
Copy link
Contributor

there is no issue regarding engine reuse for UI scripts related to this is there?

Do you have a specific issue or PR for that? I know this sounds familiar, but honestly i'm having trouble remembering it.

@jpg0
Copy link
Contributor Author

jpg0 commented Feb 7, 2022

Hmm, I had a look but can't find anything. If it was a problem, it would show up immediately though, so as long as there is basic testing (create a rule in the UI and run it, edit it and run again), then we'd catch it.

@jlaur
Copy link
Contributor

jlaur commented Feb 10, 2022

@kaikreuzer - I don't have access to openhab-core, but I think the fix for core in 3.2.1, if we want to proceed, would be:

Then in openhab-addons (modified to provide link):

FYI @jpg0, @digitaldan

wborn pushed a commit to wborn/openhab-core that referenced this pull request Apr 6, 2022
Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
@wborn wborn added the patch A PR that has been cherry-picked to a patch release branch label Apr 6, 2022
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 12, 2023
Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
GitOrigin-RevId: 59bc10a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation bug An unexpected problem or unintended behavior of the Core patch A PR that has been cherry-picked to a patch release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants