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

Wrap ScriptEngine executions in a SafeCaller #3180

Merged
merged 2 commits into from
Nov 30, 2022

Conversation

ccutrer
Copy link
Contributor

@ccutrer ccutrer commented Nov 27, 2022

See #3179 for more details.

@ccutrer ccutrer requested a review from a team as a code owner November 27, 2022 23:09
@ccutrer
Copy link
Contributor Author

ccutrer commented Nov 27, 2022

Note that if the ScriptEngine does not implement AutoCloseable, and the script itself doesn't define scriptUnloaded, nothing will prevent the script from continuing to execute in the background. As of writing, JRuby at least does not implement AutoCloseable. But at least openHAB won't be "hung".

ccutrer added a commit to ccutrer/openhab-jrubyscripting that referenced this pull request Nov 28, 2022
ccutrer added a commit to ccutrer/openhab-jrubyscripting that referenced this pull request Nov 28, 2022
@wborn wborn added the bug An unexpected problem or unintended behavior of the Core label Nov 30, 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.

It LGTM! But there is a conflict which needs to be resolved.

fixes openhab#3179

prevents scripts from being able to lock up ScriptFileWatcher permanently

Signed-off-by: Cody Cutrer <cody@cutrer.us>
@ccutrer ccutrer force-pushed the safe-caller-script-manager branch from 5e67129 to 829c150 Compare November 30, 2022 19:07
@ccutrer
Copy link
Contributor Author

ccutrer commented Nov 30, 2022

Rebase and trivial conflict resolved (dependencyTracker assignment no longer happens in the ScriptEngineManagerImpl). I did have to update the (previously non-existent) tests for ScriptEngineManagerImpl to provide a mock SafeCaller that's actually functional. The rest of the original PR is unchanged.

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.

Why did you add 4301892? Seems like it should be part #3185 only.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
@ccutrer ccutrer force-pushed the safe-caller-script-manager branch from 3ea276c to 0e00687 Compare November 30, 2022 21:02
@ccutrer
Copy link
Contributor Author

ccutrer commented Nov 30, 2022

Why did you add 4301892? Seems like it should be part #3185 only.

because I'm juggling too many things at once :). I removed that commit from the stack and force-pushed

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! My commits sometimes also end up on the wrong branches. 😄

@wborn wborn merged commit ff75505 into openhab:main Nov 30, 2022
@wborn wborn added this to the 3.4 milestone Nov 30, 2022
@wborn wborn changed the title wrap ScriptEngine executions in a SafeCaller Wrap ScriptEngine executions in a SafeCaller Nov 30, 2022
@openhab-bot
Copy link
Collaborator

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/135

@ccutrer
Copy link
Contributor Author

ccutrer commented Dec 12, 2022

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/135

Apparently 30s+ to load a script might be normal? Still need to hear back from the user, but assuming his code isn't locked up somehow, do we need to make this timeout configurable (or disable-able?). Or perhaps each script engine needs to opt-in to this behavior, indicating it can properly interrupt the user script? I don't love a configurable timeout here, since it seems like it would be very opaque for the user to know to even set it. Unless we explicitly link to the documentation from the log message?

@florian-h05
Copy link
Contributor

florian-h05 commented Dec 12, 2022

Apparently 30s+ to load a script might be normal?

On less powerful platforms like Raspberry Pi and during openHAB startup: yes, it‘s common to have such long load times.

Or perhaps each script engine needs to opt-in to this behavior, indicating it can properly interrupt the user script?

Would be an option. I am trying to fix the multithread issue in the JS Scripting add-on, but in the PR description, you stated:

Note that if the ScriptEngine does not implement AutoCloseable, and the script itself doesn't define scriptUnloaded, nothing will prevent the script from continuing to execute in the background.

Sounds like the problem that a script continues to execute in the background is only for ScriptEngines without AutoClosable.
What do you think about only using the safe caller for script engines that do not implement AutoClosable?

I don't love a configurable timeout here, since it seems like it would be very opaque for the user to know to even set it.

Leaving configuration of such things is no good idea IMO.
For those engines not implementing AutoClosable, I‘d rather increase the timeout to 60 or 90 or even 120 seconds. But TBH I have no idea how long some scripts need to load on some platforms.

@ccutrer
Copy link
Contributor Author

ccutrer commented Dec 12, 2022

Sounds like the problem that a script continues to execute in the background is only for ScriptEngines without AutoClosable.
What do you think about only using the safe caller for script engines that do not implement AutoClosable?

I think that's orthogonal.

  • With SafeCaller, on an AutoClosable ScriptEngine (JS), the intention is that a deadlocked script is interrupted and cleaned up.
  • With SafeCaller, on a non-AutoClosable ScriptEngine without a scriptUnloaded hook defined (JRuby, without my helper libraries), openHAB will log a warning that the script took too long, but essentially take no other action to interrupt the script. I can't remember off the top of my head how rules associated with the script get unloaded, but I think they'll be unloaded in this scenario. But at the least, the ScriptFileWatcher thread will no longer be hung waiting on this individual script.
  • With SafeCaller, on a non-AutoClosable ScriptEngine with a scriptUnloaded hook defined that knows how to interrupt the script from itself (JRuby, with my helper libraries), the script will end immediately, logging some sort of interrupted exception.

If we were to not use SafeCaller for any permutation of the above, then the original bug is re-introduced, regardless of language - a script that accidentally deadlocks (because of mutexes for thread safety issues; waiting indefinitely on an external resource; an accidental infinite loop; etc.) will monopolize the ScriptFileWatcher thread indefinitely, and you will not be able to unload or reload any other scripts until openHAB is restarted.

@florian-h05
Copy link
Contributor

florian-h05 commented Dec 12, 2022

Got it, thanks for the explanation. Disabling SafeCaller is therefore no option.

I think that I found a solution for the multi-thread access issues of JS Scripting by extending synchronization, but independent from this we should increase the timeout.

We should also extend the warning text to clearly indicate the script is unloaded then, so that no on wonders that his script don‘t work.

@ccutrer
Copy link
Contributor Author

ccutrer commented Dec 12, 2022

but independent from this we should increase the timeout.

Agreed. I just don't know what to. @J-N-K - any suggestions? My gut says it should be dynamic somehow, like based on number of CPUs or RAM or something. Or even better "don't timeout until we've reached start level 100" or something. But those both seem complicated. I'm fine with just going to 120 to mostly-ameliorate this for 3.4.0.

@ccutrer ccutrer deleted the safe-caller-script-manager branch December 12, 2022 17:40
florian-h05 added a commit to florian-h05/openhab-addons that referenced this pull request Dec 12, 2022
This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
florian-h05 added a commit to florian-h05/openhab-addons that referenced this pull request Dec 12, 2022
… Switch to ReentrantLock

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
florian-h05 added a commit to florian-h05/openhab-addons that referenced this pull request Dec 12, 2022
This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
florian-h05 added a commit to florian-h05/openhab-addons that referenced this pull request Dec 12, 2022
… Switch to ReentrantLock

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
ccutrer added a commit to ccutrer/openhab-core that referenced this pull request Dec 13, 2022
ccutrer added a commit to ccutrer/openhab-core that referenced this pull request Dec 13, 2022
This reverts commit ff75505.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
wborn pushed a commit that referenced this pull request Dec 13, 2022
This reverts commit ff75505.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
@wborn wborn removed the bug An unexpected problem or unintended behavior of the Core label Dec 13, 2022
jlaur pushed a commit to openhab/openhab-addons that referenced this pull request Dec 14, 2022
…13924)

* [jsscripting] Extend synchronization to common ScriptEngine methods

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* Revert "[jsscripting] Extend synchronization to common ScriptEngine methods"

This reverts commit aadd21e.

* [jsscripting] Extend synchronization to common ScriptEngine methods & Switch to ReentrantLock

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* [jsscripting] Reduce compiler warnings
* [jsscripting] Replace finally blocks & Wrap returns in afterInvocation
* [jsscripting] Fix deadlock caused by NoSuchMethodException in Invocable interface methods

During testing my latest changes, I noticed that there is a deadlock when invokeFunction or invokeMethod are called on a non-existing method.
This happens because the NoSuchMethodException keeps afterInvocation from running and therefore the lock never gets released.

* [jsscripting] Also rethrow NPE & Fix PMD warnings/errors
* [jsscripting] Wrap and rethrow other exceptions instead of returning them
* [jsscripting] Address review comment from @jpg0

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
morph166955 pushed a commit to morph166955/openhab-addons that referenced this pull request Dec 18, 2022
…penhab#13924)

* [jsscripting] Extend synchronization to common ScriptEngine methods

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* Revert "[jsscripting] Extend synchronization to common ScriptEngine methods"

This reverts commit aadd21e.

* [jsscripting] Extend synchronization to common ScriptEngine methods & Switch to ReentrantLock

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* [jsscripting] Reduce compiler warnings
* [jsscripting] Replace finally blocks & Wrap returns in afterInvocation
* [jsscripting] Fix deadlock caused by NoSuchMethodException in Invocable interface methods

During testing my latest changes, I noticed that there is a deadlock when invokeFunction or invokeMethod are called on a non-existing method.
This happens because the NoSuchMethodException keeps afterInvocation from running and therefore the lock never gets released.

* [jsscripting] Also rethrow NPE & Fix PMD warnings/errors
* [jsscripting] Wrap and rethrow other exceptions instead of returning them
* [jsscripting] Address review comment from @jpg0

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Ben Rosenblum <rosenblumb@gmail.com>
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Dec 24, 2022
…penhab#13924)

* [jsscripting] Extend synchronization to common ScriptEngine methods

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* Revert "[jsscripting] Extend synchronization to common ScriptEngine methods"

This reverts commit aadd21e.

* [jsscripting] Extend synchronization to common ScriptEngine methods & Switch to ReentrantLock

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* [jsscripting] Reduce compiler warnings
* [jsscripting] Replace finally blocks & Wrap returns in afterInvocation
* [jsscripting] Fix deadlock caused by NoSuchMethodException in Invocable interface methods

During testing my latest changes, I noticed that there is a deadlock when invokeFunction or invokeMethod are called on a non-existing method.
This happens because the NoSuchMethodException keeps afterInvocation from running and therefore the lock never gets released.

* [jsscripting] Also rethrow NPE & Fix PMD warnings/errors
* [jsscripting] Wrap and rethrow other exceptions instead of returning them
* [jsscripting] Address review comment from @jpg0

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
andrewfg added a commit to andrewfg/openhab-addons that referenced this pull request Dec 27, 2022
commit 1df693a
Author: lsiepel <leosiepel@gmail.com>
Date:   Tue Dec 27 16:27:19 2022 +0100

    [bluetooth.am43] null annotations (openhab#13972)

    * null annotations forbidden package
    * improve createChecksum
    * spotless + typo

    Signed-off-by: lsiepel <leosiepel@gmail.com>

commit 8b1d0fc
Author: lsiepel <leosiepel@gmail.com>
Date:   Tue Dec 27 16:16:55 2022 +0100

    null annotations - checkstyle (openhab#13979)

    Signed-off-by: Leo Siepel <leosiepel@gmail.com>

commit df6454e
Author: lsiepel <leosiepel@gmail.com>
Date:   Tue Dec 27 16:13:12 2022 +0100

    minro checkstyle (openhab#13977)

    Signed-off-by: Leo Siepel <leosiepel@gmail.com>

commit 9687c3d
Author: Jiri Kraus <jkraus@nvidia.com>
Date:   Tue Dec 27 16:08:12 2022 +0100

    [velux] Updated Discovery instructions for scenes and actuators (openhab#14009)

    * Updated Discovery instructions for scenes and actuators

    Updated Discovery instructions as after KLF200 is auto discovered and configured discovery of scenes and actuators need to be manually triggered.

    * @jirikraus Updated Discovery instructions for scenes and actuators

    Formatting update to address comment from @andrewfg.

commit 35e930c
Author: lsiepel <leosiepel@gmail.com>
Date:   Tue Dec 27 12:56:43 2022 +0100

    [astro] Added moon phase precision (openhab#14067)

    * add more precision to MoonPhase.Age

    Signed-off-by: lsiepel <leosiepel@gmail.com>

commit 4a98295
Author: mlobstein <michael.lobstein@gmail.com>
Date:   Tue Dec 27 05:54:26 2022 -0600

    [nuvo] Auto update source channel for grouped zones (openhab#14012)

    * Auto update source channel for grouped zones

    Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>

commit e39e691
Author: Cody Cutrer <cody@cutrer.us>
Date:   Tue Dec 27 03:55:12 2022 -0700

    [homekit] support Rollershutter items for HoldPosition (openhab#14045)

    * [homekit] support Rollershutter items for HoldPosition

    just send STOP to them

    * [homekit] log a warning for incompatible HoldPosition items

    Signed-off-by: Cody Cutrer <cody@cutrer.us>

commit 0b59be6
Author: Jacob Laursen <jacob-github@vindvejr.dk>
Date:   Tue Dec 27 11:41:59 2022 +0100

    Skip loading/migrating items with invalid name (openhab#14054)

    Fixes openhab#14053

    Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

commit e7938ae
Author: Holger Friedrich <holgerfriedrich@users.noreply.github.com>
Date:   Tue Dec 27 10:55:15 2022 +0100

    [rrd4j] Improve logging of exceptions thrown by getDB (openhab#14068)

    Add exception message for better identification of root cause.

    Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>

commit e5f30b1
Author: Tim Harper <tharper@d2iq.com>
Date:   Tue Dec 27 02:25:28 2022 -0700

    [tplinksmarthome] Document sending raw commands to devices (openhab#14062)

    Signed-off-by: Tim Harper <timcharper@gmail.com>

    Signed-off-by: Tim Harper <timcharper@gmail.com>

commit 1c5b794
Author: lsiepel <leosiepel@gmail.com>
Date:   Mon Dec 26 17:00:53 2022 +0100

    [airvisualnode] Add null annotations (openhab#13895)

    * Add null annotation

    Signed-off-by: Leo Siepel <leosiepel@gmail.com>

commit 88c0b72
Author: Wouter Born <github@maindrain.net>
Date:   Mon Dec 26 15:27:03 2022 +0100

    [jsscriptingnashorn] JavaScript Scripting Nashorn Automation  (openhab#14013)

    * [jsscriptingnashorn] JavaScript Scripting Nashorn Automation

    This add-on allows you to use your older JavaScript (ECMAScript 5.1) rules on newer Java versions until they are migrated to JavaScript (ECMAScript 2021+).
    The add-on uses a standalone [Nashorn Engine](https://github.com/openjdk/nashorn) which was part of Java until it was removed in Java 15.

    * Update parent to 3.4.0-SNAPSHOT and nashorn-core to 15.4

    For the Nashorn changelog, see:

    https://github.com/openjdk/nashorn/blob/main/CHANGELOG.md

    * Update parent to 4.0.0-SNAPSHOT
    * Remove removeUnsupportedNashornArgs
    * Update scriptTypes
    * Add CODEOWNERS entry
    * Recycle ScriptScopeOSGiTest.java

    It got removed in openhab/openhab-core#2994

    * Remove redundant new line from pom.xml

    Signed-off-by: Wouter Born <github@maindrain.net>

commit 605574b
Author: Hilbrand Bouwkamp <hilbrand@h72.nl>
Date:   Mon Dec 26 10:17:42 2022 +0100

    Set openHAB to correct version in binding skeleton scripts. (openhab#14061)

    Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>

commit 6cd59e4
Author: Jørgen Austvik <jaustvik@acm.org>
Date:   Sun Dec 25 20:56:04 2022 +0100

    [nanoleaf] More robust caching of layout (openhab#13998)

    * [nanoleaf] More robust caching of layout

    This is a bugfix/enhancement to make sure the caching of the layout
    (to save it from being recalculated) works better:
    - Only save previous layout if indeed painted
    - Only save layout from the layout update, not the display state
    - Recalculate anyway if current state is null

    * Bugfix: Update colors

    When Stefan runs, the getBridge() returns null, when Jørgen runs, is doesn't. But it isn't needed, because we
    are already in the handler, so just call own methods.

    Improvement: Less draws when updating colors

    Instead of drawing the picture for each panel (which gave a cool effect), draw only once when we have parsed all color data.

    Signed-off-by: Jørgen Austvik <jaustvik@acm.org>

commit 0357049
Author: Holger Friedrich <holgerfriedrich@users.noreply.github.com>
Date:   Sat Dec 24 12:11:28 2022 +0100

    [knx] Fix SAT warnings (openhab#14052)

    Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>

commit f619798
Author: Cody Cutrer <cody@cutrer.us>
Date:   Fri Dec 23 16:00:57 2022 -0700

    [lifx] Handle and provide QuantityType for color-temperature-abs channel (openhab#14025)

    See openhab/openhab-core#3129

    Signed-off-by: Cody Cutrer <cody@cutrer.us>

commit b62e145
Author: Cody Cutrer <cody@cutrer.us>
Date:   Fri Dec 23 15:41:44 2022 -0700

    [homekit] Allow configuring secondary services as members of a group (openhab#13879)

    * [homekit] allow configuring secondary services as members of a group

    Required introduction of AccessoryGroup to represent the base
    AccessoryInformationService for ease of configuring multiple of the
    same service.

    This is also "breaking" in that someone who previously had HomeKit
    accessories nested directly inside of a group that was itself a
    HomeKit accessory will now have those items grouped within the Home
    app.

    * [homekit] combine multiple readme sections on complex accessories

    Signed-off-by: Cody Cutrer <cody@cutrer.us>

commit b1d4c40
Author: Wouter Born <github@maindrain.net>
Date:   Fri Dec 23 14:10:58 2022 +0100

    Remove JavaScript Transformation pom.xml (openhab#14048)

    Everything except for this pom.xml got removed in openhab#13276

    Signed-off-by: Wouter Born <github@maindrain.net>

commit 7c2d5dc
Author: Cody Cutrer <cody@cutrer.us>
Date:   Thu Dec 22 16:16:55 2022 -0700

    [homekit] implement List-Pairings method (openhab#13982)

    * [homekit] implement List-Pairings method
    * [homekit] fix listUsers() method
    * [homekit] bump HAP-java to 2.0.5

    refs openhab#13949

    Signed-off-by: Cody Cutrer <cody@cutrer.us>

commit fbf302e
Author: Wouter Born <github@maindrain.net>
Date:   Fri Dec 23 00:13:17 2022 +0100

    Use HTTPS in pom.xml where possible (openhab#14044)

    Signed-off-by: Wouter Born <github@maindrain.net>

commit 14c8b39
Author: Andreas Berger <Andy2003@users.noreply.github.com>
Date:   Thu Dec 22 21:17:07 2022 +0100

    [fineoffsetweatherstation] Fix QuantityType for rain-rate (openhab#14039)

    A community member realized, that the used unit for rain-rate was wrong (https://community.openhab.org/t/fine-offset-weather-station-binding-discussion/134167/153)
    Rain rate is measured in mm/h and so it is not a `VolumetricFlowRate` but a `Speed`.

    Additionally, I added some details to the doc.

    Signed-off-by: Andreas Berger <andreas@berger-freelancer.com>

commit af16d52
Author: Wouter Born <github@maindrain.net>
Date:   Thu Dec 22 18:21:13 2022 +0100

    Fix "Hello, World!" examples in automation documentation (openhab#14041)

    The documentation states incorrectly that "Hello, World!" is printed when instead "Hello world!" is printed.

    Signed-off-by: Wouter Born <github@maindrain.net>

commit 7195825
Author: lolodomo <lg.hc@free.fr>
Date:   Thu Dec 22 18:17:15 2022 +0100

    [keba] Fix unit in example for power channel (openhab#14031)

    Related to openhab#12529

    Signed-off-by: Laurent Garnier <lg.hc@free.fr>

commit 16fcd5d
Author: lsiepel <leosiepel@gmail.com>
Date:   Thu Dec 22 09:04:50 2022 +0100

    nul;l annotations and codestyle (openhab#13980)

    Signed-off-by: lsiepel <leosiepel@gmail.com>

commit fb31c14
Author: lsiepel <leosiepel@gmail.com>
Date:   Thu Dec 22 08:58:12 2022 +0100

    [bluetooth.govee] null annotations (openhab#13978)

    * null annotations and checkstyle
    * Fix more warnings

    Signed-off-by: lsiepel <leosiepel@gmail.com>

commit a079603
Author: Cody Cutrer <cody@cutrer.us>
Date:   Wed Dec 21 16:37:26 2022 -0700

    [homekit] allow configuring min/max light level (openhab#14034)

    since the default is weirdly 0.0001, yet my sensors can report a
    straight 0.

    Signed-off-by: Cody Cutrer <cody@cutrer.us>

commit 462dca8
Author: Cody Cutrer <cody@cutrer.us>
Date:   Wed Dec 21 16:31:05 2022 -0700

    [homekit] update AuthInfo objects when blockUserDeletion changes (openhab#14017)

    * [homekit] update AuthInfo objects when blockUserDeletion changes

    Signed-off-by: Cody Cutrer <cody@cutrer.us>

    * [homekit] general cleanup of redundant method call and unused local vars

    Signed-off-by: Cody Cutrer <cody@cutrer.us>

    Signed-off-by: Cody Cutrer <cody@cutrer.us>

commit 672b60b
Author: Cody Cutrer <cody@cutrer.us>
Date:   Wed Dec 21 14:43:46 2022 -0700

    [nanoleaf] Handle and provide QuantityType for color-temperature-abs channel (openhab#14026)

    * [nanoleaf] handle and provide QuantityType for color-temperature-abs channel

    see openhab/openhab-core#3129

    Signed-off-by: Cody Cutrer <cody@cutrer.us>

commit df8e0bb
Author: Cody Cutrer <cody@cutrer.us>
Date:   Wed Dec 21 12:21:53 2022 -0700

    [dali] tweak color temperature abs QuantityType fix (openhab#14029)

    adds an example of usage of the channel to the README, and
    simplifies one method call

    Signed-off-by: Cody Cutrer <cody@cutrer.us>

commit a0c2c76
Author: Christoph Weitkamp <github@christophweitkamp.de>
Date:   Wed Dec 21 20:10:21 2022 +0100

    [hue] Allow handling of QuantityType for color temperature channel (openhab#14024)

    * Allow handling of QuantityType for color temperature channel
    * Fixed log messages and reduce log level.

    Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>

commit 528140d
Author: Christoph Weitkamp <github@christophweitkamp.de>
Date:   Wed Dec 21 17:24:57 2022 +0100

    [darksky] Remove DarkSky binding due to EOL of their API (openhab#13037)

    * Remove DarkSky binding due to EOL of their API

    Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>

commit 324483d
Author: Cody Cutrer <cody@cutrer.us>
Date:   Tue Dec 20 13:15:10 2022 -0700

    [dali] handle and provide QuantityType for color-temperature-abs channel (openhab#14021)

    see openhab/openhab-core#3129

    Signed-off-by: Cody Cutrer <cody@cutrer.us>

commit 4d98cca
Author: Florian Hotze <florianh_dev@icloud.com>
Date:   Tue Dec 20 09:15:43 2022 +0100

    [jsscripting] Minor fixes & improvements (openhab#13960)

    * [jsscripting] Correct wrong `createScriptEngine` implementation
    * [jsscripting] Also unlock lock on unexpected exceptions (rethrow them)
    * [jsscripting] Call super methods from their overrides
    * [jsscripting] Move superclass call of `beforeInvocation`

    Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

commit cd9e1b0
Author: J-N-K <github@klug.nrw>
Date:   Tue Dec 20 08:11:31 2022 +0100

    Fix build / Resolve itests (openhab#14018)

    * Fix build / Resolve itests
    * Remove Java 11 from GHA matrix

    Also-by: Wouter Born <github@maindrain.net>
    Signed-off-by: Jan N. Klug <github@klug.nrw>

commit 0b1eb2c
Author: lsiepel <leosiepel@gmail.com>
Date:   Tue Dec 20 00:06:52 2022 +0100

    null annotations (openhab#13976)

    Signed-off-by: Leo Siepel <leosiepel@gmail.com>

commit 1519cb4
Author: lsiepel <leosiepel@gmail.com>
Date:   Tue Dec 20 00:04:43 2022 +0100

    nul annotations, checkstyle, forbidden packagel (openhab#13981)

    Signed-off-by: lsiepel <leosiepel@gmail.com>

commit 40b8b77
Author: lsiepel <leosiepel@gmail.com>
Date:   Tue Dec 20 00:01:50 2022 +0100

    Very minor checkstyle (openhab#13973)

    Signed-off-by: Leo Siepel <leosiepel@gmail.com>

commit 127f998
Author: Jacob Laursen <jacob-github@vindvejr.dk>
Date:   Mon Dec 19 23:49:51 2022 +0100

    Upgrade MySQL Connector/J to 8.0.31 (openhab#13991)

    Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

commit 3bec273
Author: Holger Friedrich <holgerfriedrich@users.noreply.github.com>
Date:   Mon Dec 19 22:58:43 2022 +0100

    [rrd4j] Upgrade base library from 3.8.1 to 3.8.2 (openhab#13956)

    Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>

commit 3aefefb
Author: Holger Friedrich <holgerfriedrich@users.noreply.github.com>
Date:   Mon Dec 19 22:49:40 2022 +0100

    [knx] Upgrade Calimero library to release 2.5.1 (openhab#14015)

    Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>

commit 9f3b8e1
Author: J-N-K <github@klug.nrw>
Date:   Mon Dec 19 20:39:42 2022 +0100

    Raise minimum JDK version to 17 (openhab#13276)

    Signed-off-by: Jan N. Klug <github@klug.nrw>

commit 4d6d644
Author: J-N-K <github@klug.nrw>
Date:   Mon Dec 19 15:22:17 2022 +0100

    fix spotless after release (openhab#14014)

    Signed-off-by: Jan N. Klug <github@klug.nrw>

commit 7993786
Author: openhab-bot <infrastructure@openhabfoundation.org>
Date:   Mon Dec 19 00:55:11 2022 +0000

    [unleash-maven-plugin] Preparation for next development cycle.

commit c5b68d0
Author: Jacob Laursen <jacob-github@vindvejr.dk>
Date:   Sun Dec 18 23:22:40 2022 +0100

    Fix NullPointerException (openhab#14010)

    Fixes openhab#13961

    Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

commit 4871d6d
Author: Wouter Born <github@maindrain.net>
Date:   Sun Dec 18 19:50:23 2022 +0100

    [shelly] Remove broken images (openhab#14007)

    See also openhab#13993

    Signed-off-by: Wouter Born <github@maindrain.net>

commit 8d65371
Author: Wouter Born <github@maindrain.net>
Date:   Sun Dec 18 19:49:42 2022 +0100

    [shelly] Remove broken images (openhab#14007)

    See also openhab#13993

    Signed-off-by: Wouter Born <github@maindrain.net>

commit 3613799
Author: Kai Takac <kai.takac@gmail.com>
Date:   Sun Dec 18 19:04:43 2022 +0100

    [jdbc] Update org.xerial/sqlite-jdbc to 3.40.0.0 (openhab#14003)

    * [jdbc] Update org.xerial/sqlite-jdbc to 3.40.0.0

    Co-authored-by: Jacob Laursen <jacob-github@vindvejr.dk>
    Signed-off-by: Kai Takac <kai.takac@gmail.com>

commit ef836a1
Author: Дилян Палаузов <git-dpa@aegee.org>
Date:   Sun Dec 18 15:18:24 2022 +0200

    typos: success, successful (openhab#13997)

commit 6b1354f
Author: openhab-bot <bot@openhab.org>
Date:   Sun Dec 18 14:02:15 2022 +0100

    New Crowdin updates (openhab#13999)

    * New translations iCloud.properties (French)

    * New translations openwebnet.properties (Italian)

    * New translations plugwise.properties (Dutch)

commit 6dd8cd5
Author: MikeTheTux <44850211+MikeTheTux@users.noreply.github.com>
Date:   Sun Dec 18 13:35:08 2022 +0100

    fixed potential StringIndexOutOfBoundsExceptions (openhab#14000)

    fixed compiler warnings

    Signed-off-by: Michael Weger <weger.michael@gmx.net>

commit debdfa5
Author: Holger Friedrich <holgerfriedrich@users.noreply.github.com>
Date:   Sun Dec 18 11:55:59 2022 +0100

    [wolfsmartset] Fix link to external documentation (openhab#13996)

    Update link to current document from Wolf download center.
    Fixes openhab#13995.

    Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>

commit 9b89130
Author: Jacob Laursen <jacob-github@vindvejr.dk>
Date:   Sun Dec 18 10:22:07 2022 +0100

    Fix alignment/indentation (openhab#13994)

    Fixes openhab#13882

    Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

commit d03d3e4
Author: Wouter Born <github@maindrain.net>
Date:   Sat Dec 17 23:53:57 2022 +0100

    Show add-on intros in Main UI (openhab#13992)

    Using these Markdown tweaks a small intro will show in Main UI instead of emptyness and a "more" button.

    Signed-off-by: Wouter Born <github@maindrain.net>

commit 6753234
Author: Jacob Laursen <jacob-github@vindvejr.dk>
Date:   Sat Dec 17 17:25:38 2022 +0100

    Fix Zigbee name stylization (openhab#13954)

    Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

commit d20b103
Author: openhab-bot <bot@openhab.org>
Date:   Sat Dec 17 16:51:35 2022 +0100

    New Crowdin updates (openhab#13990)

    * New translations tr064.properties (German)
    * New translations jsscripting.properties (Danish)
    * New translations jsscripting.properties (Italian)

commit 15e6beb
Author: Florian Hotze <florianh_dev@icloud.com>
Date:   Sat Dec 17 15:42:23 2022 +0100

    [yamaha] README: Recommend correct binding for specific model (openhab#13985)

    This doc improvement tries to avoid future issue like openhab#10838.

    Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

commit 11e2c4f
Author: Florian Hotze <florianh_dev@icloud.com>
Date:   Sat Dec 17 13:40:12 2022 +0100

    [jsscripting] Update add-on name in default translation (openhab#13984)

    Leftover from openhab#13764.

    Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

commit 4a13e1a
Author: openhab-bot <bot@openhab.org>
Date:   Sat Dec 17 12:13:24 2022 +0100

    New Crowdin updates (openhab#13971)

    * New translations knx.properties (German)
    * New translations yamahamusiccast.properties (German)
    * New translations hdpowerview.properties (Danish)
    * New translations jsscripting.properties (Danish)

commit 23875a6
Author: Wouter Born <github@maindrain.net>
Date:   Fri Dec 16 11:22:48 2022 +0100

    [mapdb] Fix "a" typo and use "-" for bullets in docs (openhab#13966)

    Signed-off-by: Wouter Born <github@maindrain.net>

commit ab504bc
Author: Dan Cunningham <dan@digitaldan.com>
Date:   Thu Dec 15 23:31:02 2022 -0800

    [hydrawise] fixes null pointer error for some sprinkler controllers (openhab#13965)

    Signed-off-by: Dan Cunningham <dan@digitaldan.com>

commit 15ad22b
Author: Wouter Born <github@maindrain.net>
Date:   Thu Dec 15 23:39:37 2022 +0100

    [mapdb] Add some documentation (openhab#13964)

    This is based on the original OH1 documentation.

    Signed-off-by: Wouter Born <github@maindrain.net>

commit d6db727
Author: openhab-bot <bot@openhab.org>
Date:   Thu Dec 15 23:36:49 2022 +0100

    New Crowdin updates (openhab#13962)

    * New translations chromecast.properties (Italian)
    * New translations sonos.properties (Italian)
    * New translations exec.properties (Italian)
    * New translations knx.properties (German)
    * New translations jsscripting.properties (German)
    * New translations yamahamusiccast.properties (German)

commit c75b04e
Author: Wouter Born <github@maindrain.net>
Date:   Thu Dec 15 22:40:52 2022 +0100

    [wundergroundupdatereceiver] Prevent 😕 showing in documentation (openhab#13963)

    See: https://www.openhab.org/addons/bindings/wundergroundupdatereceiver/

    Signed-off-by: Wouter Born <github@maindrain.net>

commit 9318f6f
Author: Holger Friedrich <holgerfriedrich@users.noreply.github.com>
Date:   Thu Dec 15 16:22:43 2022 +0100

    [knx] Minor documentation update (openhab#13918)

    Slightly change wording of docs related to localSourceAddress to avoid
    address conflicts during initial setup.
    Add remark about knxd.
    Fixes openhab#13602.

    Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>

commit 83f0f7a
Author: Wouter Born <github@maindrain.net>
Date:   Thu Dec 15 12:28:32 2022 +0100

    Prevent Markdown rendering issues in Main UI (openhab#13958)

    Some add-ons use `---` separators which causes issues when rendering the documentation in Main UI.

    Fixes openhab#13953

    Signed-off-by: Wouter Born <github@maindrain.net>

commit 6ab0561
Author: Holger Friedrich <holgerfriedrich@users.noreply.github.com>
Date:   Thu Dec 15 11:31:20 2022 +0100

    [rrd4j] Error handling for broken rrd4j files (openhab#13955)

    * [rrd4j] Error handling for broken rrd4j files

    Catch exceptions thrown by getDB(..) and print the name of the affected
    database file. This allows to identify a broken rrd4j file.

    Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>

commit 04f059c
Author: Simon Spielmann <simon.spielmann@gmx.de>
Date:   Thu Dec 15 09:18:11 2022 +0100

    [icloud] Rework authentication to reflect changes in iCloud API (openhab#13691)

    * Implement Authentication (WIP)
    * Validation Code accepted
    * Refactor session state
    * RefreshClient working
    * Implement session persistence in openhab store
    * Integration in binding
    * Remove persistent cookies, which break authentication
    * Bugfixing
    * Add code configuration to UI
    * Improve documentation, error-handling and cleanup
    * Rework auth order
    * Rework auth process
    * Add 2-FA-auth to documentation
    * Set bridge to online if data refresh works
    * Case-sensitive rename ICloudAPIResponseException
    * Include authentication in refresh flow
    * Fix regression for data not being updated
    * Fix typo in i18n props
    * Fix review and checkstyle.
    * More javadoc, new RetryException
    * Introduce @NonNullByDefault
    * Introduce server for RetryException, add NonNullbyDefault, fix warnings
    * Rework for contribution, e.g. null checks, ...
    * Fix checkstyle
    * Move JsonUtils to utilities package
    * Async initialize bridge handler.
    * Report Device OFFLINE if Bridge is OFFLINE
    * Set bridge thing status to UNKOWN in init
    * Move refresh init into async init
    * Cancel init task in dispose

    Also-by: Leo Siepel <leosiepel@gmail.com>
    Signed-off-by: Simon Spielmann <simon.spielmann@gmx.de>

commit 6e8b35c
Author: Wouter Born <github@maindrain.net>
Date:   Thu Dec 15 07:51:22 2022 +0100

    [jsscripting] Fix broken event object table (openhab#13952)

    The table is not properly rendered when reading the documentation in Main UI.

    Signed-off-by: Wouter Born <github@maindrain.net>

commit 79060f3
Author: Jørgen Austvik <jaustvik@acm.org>
Date:   Wed Dec 14 20:15:47 2022 +0100

    [nanoleaf] Bugfix: Handle non-integer panel ids (openhab#13951)

    Panel ids are sometimes returned as BigInteger

    We haven't been able to understand why this happens somewhere and
    somewhere not, but this is an sledgehammer attempt to fix it quickly
    to unblock users, and then we will try to understand it later.

    Discussions:
    https://community.openhab.org/t/java-lang-classcastexception-class-java-math-bigdecimal-cannot-be-cast-to-class-java-lang-integer/142035/16
    https://community.openhab.org/t/nanoleaf-binding-oh3-stabilization-update/116300/61

    Signed-off-by: Jørgen Austvik <jaustvik@acm.org>

commit d4ec220
Author: Florian Hotze <florianh_dev@icloud.com>
Date:   Wed Dec 14 20:12:54 2022 +0100

    [jsscripting] Extend synchronization to common ScriptEngine methods (openhab#13924)

    * [jsscripting] Extend synchronization to common ScriptEngine methods

    This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

    * Revert "[jsscripting] Extend synchronization to common ScriptEngine methods"

    This reverts commit aadd21e.

    * [jsscripting] Extend synchronization to common ScriptEngine methods & Switch to ReentrantLock

    This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
    The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
    Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

    * [jsscripting] Reduce compiler warnings
    * [jsscripting] Replace finally blocks & Wrap returns in afterInvocation
    * [jsscripting] Fix deadlock caused by NoSuchMethodException in Invocable interface methods

    During testing my latest changes, I noticed that there is a deadlock when invokeFunction or invokeMethod are called on a non-existing method.
    This happens because the NoSuchMethodException keeps afterInvocation from running and therefore the lock never gets released.

    * [jsscripting] Also rethrow NPE & Fix PMD warnings/errors
    * [jsscripting] Wrap and rethrow other exceptions instead of returning them
    * [jsscripting] Address review comment from @jpg0

    Signed-off-by: Florian Hotze <florianh_dev@icloud.com>

commit 1ca9baf
Author: Jerome Luckenbach <github@luckenba.ch>
Date:   Wed Dec 14 16:52:43 2022 +0100

    [Documentation] Markdown improvements n to s (openhab#13948)

    Signed-off-by: Jerome Luckenbach <github@luckenba.ch>

commit d73218d
Author: Udo Hartmann <udo1toni@users.noreply.github.com>
Date:   Wed Dec 14 08:21:34 2022 +0100

    [mqtt.generic] Change color example (openhab#13861)

    Change color example to fit to the real parameters.

commit 4aca2c6
Author: Cody Cutrer <cody@cutrer.us>
Date:   Tue Dec 13 15:28:55 2022 -0700

    [jrubyscripting] remove some development logging that crept in (openhab#13947)

    Signed-off-by: Cody Cutrer <cody@cutrer.us>

commit 8314433
Author: lolodomo <lg.hc@free.fr>
Date:   Tue Dec 13 09:04:16 2022 +0100

    [mielecloud] Fix integration tests (openhab#13935)

    Code change provided by @BjoernLange

    Signed-off-by: Laurent Garnier <lg.hc@free.fr>

commit e9473ca
Author: Hilbrand Bouwkamp <hilbrand@h72.nl>
Date:   Tue Dec 13 08:40:10 2022 +0100

    [airq] fix table in readme that broke rendering markup (openhab#13937)

    Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>

commit 9c3ec38
Author: openhab-bot <bot@openhab.org>
Date:   Tue Dec 13 07:27:26 2022 +0100

    New Crowdin updates (openhab#13932)

    * New translations boschshc.properties (Italian)

    * New translations ecowatt.properties (French)

    * New translations nikohomecontrol.properties (Dutch)

    * New translations systeminfo.properties (Dutch)

    * New translations upnpcontrol.properties (Dutch)

commit bd087f1
Author: Jacob Laursen <jacob-github@vindvejr.dk>
Date:   Mon Dec 12 22:55:38 2022 +0100

    Fix examples after migration of time channels (openhab#13933)

    Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

commit 286a27d
Author: Wouter Born <github@maindrain.net>
Date:   Mon Dec 12 22:12:24 2022 +0100

    [nest] Add missing enable SDM API configuration step to README.md (openhab#13931)

    Fixes openhab#11814

    Signed-off-by: Wouter Born <github@maindrain.net>

commit 518272a
Author: Jacob Laursen <jacob-github@vindvejr.dk>
Date:   Mon Dec 12 22:10:48 2022 +0100

    Fix dimension for powerConsumption channel (openhab#13930)

    Fixes openhab#13929

    Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>

commit e027932
Author: lolodomo <lg.hc@free.fr>
Date:   Mon Dec 12 20:28:59 2022 +0100

    [goecharger] Consider correct channel ID (maxCurrentTemp) (openhab#13927)

    Fix openhab#13891

    Signed-off-by: Laurent Garnier <lg.hc@free.fr>
borazslo pushed a commit to borazslo/openhab-mideaac-addon that referenced this pull request Jan 8, 2023
…penhab#13924)

* [jsscripting] Extend synchronization to common ScriptEngine methods

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* Revert "[jsscripting] Extend synchronization to common ScriptEngine methods"

This reverts commit aadd21e.

* [jsscripting] Extend synchronization to common ScriptEngine methods & Switch to ReentrantLock

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* [jsscripting] Reduce compiler warnings
* [jsscripting] Replace finally blocks & Wrap returns in afterInvocation
* [jsscripting] Fix deadlock caused by NoSuchMethodException in Invocable interface methods

During testing my latest changes, I noticed that there is a deadlock when invokeFunction or invokeMethod are called on a non-existing method.
This happens because the NoSuchMethodException keeps afterInvocation from running and therefore the lock never gets released.

* [jsscripting] Also rethrow NPE & Fix PMD warnings/errors
* [jsscripting] Wrap and rethrow other exceptions instead of returning them
* [jsscripting] Address review comment from @jpg0

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
psmedley pushed a commit to psmedley/openhab-addons that referenced this pull request Feb 23, 2023
…penhab#13924)

* [jsscripting] Extend synchronization to common ScriptEngine methods

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* Revert "[jsscripting] Extend synchronization to common ScriptEngine methods"

This reverts commit aadd21e.

* [jsscripting] Extend synchronization to common ScriptEngine methods & Switch to ReentrantLock

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* [jsscripting] Reduce compiler warnings
* [jsscripting] Replace finally blocks & Wrap returns in afterInvocation
* [jsscripting] Fix deadlock caused by NoSuchMethodException in Invocable interface methods

During testing my latest changes, I noticed that there is a deadlock when invokeFunction or invokeMethod are called on a non-existing method.
This happens because the NoSuchMethodException keeps afterInvocation from running and therefore the lock never gets released.

* [jsscripting] Also rethrow NPE & Fix PMD warnings/errors
* [jsscripting] Wrap and rethrow other exceptions instead of returning them
* [jsscripting] Address review comment from @jpg0

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Feb 28, 2023
…penhab#13924)

* [jsscripting] Extend synchronization to common ScriptEngine methods

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* Revert "[jsscripting] Extend synchronization to common ScriptEngine methods"

This reverts commit aadd21e.

* [jsscripting] Extend synchronization to common ScriptEngine methods & Switch to ReentrantLock

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* [jsscripting] Reduce compiler warnings
* [jsscripting] Replace finally blocks & Wrap returns in afterInvocation
* [jsscripting] Fix deadlock caused by NoSuchMethodException in Invocable interface methods

During testing my latest changes, I noticed that there is a deadlock when invokeFunction or invokeMethod are called on a non-existing method.
This happens because the NoSuchMethodException keeps afterInvocation from running and therefore the lock never gets released.

* [jsscripting] Also rethrow NPE & Fix PMD warnings/errors
* [jsscripting] Wrap and rethrow other exceptions instead of returning them
* [jsscripting] Address review comment from @jpg0

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 12, 2023
Fixes openhab#3179

Signed-off-by: Cody Cutrer <cody@cutrer.us>
GitOrigin-RevId: ff75505
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 12, 2023
…penhab#3227)

This reverts commit ff75505.

Signed-off-by: Cody Cutrer <cody@cutrer.us>
GitOrigin-RevId: 1d8d04f
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Jan 6, 2024
…penhab#13924)

* [jsscripting] Extend synchronization to common ScriptEngine methods

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the DelegatingScriptEngineWithInvocableAndAutocloseableAndSynchronization class. Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* Revert "[jsscripting] Extend synchronization to common ScriptEngine methods"

This reverts commit aadd21e.

* [jsscripting] Extend synchronization to common ScriptEngine methods & Switch to ReentrantLock

This extends the multi-thread synchronization to "eval" and "invokeMethod" and moves synchronization for "invokeFunction" to the InvocationInterceptingScriptEngineWithInvocableAndAutoCloseable class.
The synchronization mechanism changed from using synchronized to using a ReentrantLock together with catch_finally to avoid having deadlocks when an exception is thrown.
Fixes the multi-thread access requested warnings described in the community (https://community.openhab.org/t/openhab-3-4-milestone-discussion/138093/130) and related to openhab/openhab-core#3180.

* [jsscripting] Reduce compiler warnings
* [jsscripting] Replace finally blocks & Wrap returns in afterInvocation
* [jsscripting] Fix deadlock caused by NoSuchMethodException in Invocable interface methods

During testing my latest changes, I noticed that there is a deadlock when invokeFunction or invokeMethod are called on a non-existing method.
This happens because the NoSuchMethodException keeps afterInvocation from running and therefore the lock never gets released.

* [jsscripting] Also rethrow NPE & Fix PMD warnings/errors
* [jsscripting] Wrap and rethrow other exceptions instead of returning them
* [jsscripting] Address review comment from @jpg0

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Single JSR223 script can permanently lock up all other scripts from loading
4 participants