[denonmarantz] Auto-configuration is blocking initialize
#16806
Labels
bug
An unexpected problem or unintended behavior of an add-on
initialize
#16806
The binding provides auto-configuration that will try to detect protocol, port and number of zones.
The way this is implemented is by calling a method from initialize:
openhab-addons/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/handler/DenonMarantzHandler.java
Lines 306 to 317 in bae5b0c
This method will then perform up to three blocking calls with a timeout of three seconds each:
openhab-addons/bundles/org.openhab.binding.denonmarantz/src/main/java/org/openhab/binding/denonmarantz/internal/handler/DenonMarantzHandler.java
Lines 205 to 304 in bae5b0c
This can potentially block
initialize
for up to nine seconds on first initialization, and at least six seconds for unresponding hosts.Expected Behavior
The framework expects
initialize()
to be non-blocking and to return quickly. See https://www.openhab.org/docs/developer/bindings/#startupCurrent Behavior
When creating a Thing with an IP address that doesn't exist on the network (similar to a powered off receiver):
Possible Solution
The auto-configuration phase could be scheduled to be executed in a separate thread.
Steps to Reproduce
See above.
Context
Your Environment
The text was updated successfully, but these errors were encountered: