-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[mqtt] Discovery services shall not unsubscribe unless they have already subscribed #10566
Conversation
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/mqtt-strange-logger-warnings-on-oh-shutdown/121228/17 |
…listener in listenerList Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
I found a way to install all the dependencies so I was able to test it :) |
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@jochen314 done. |
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we now improve the thread saftey, it will look good to me
...hab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/AbstractMQTTDiscovery.java
Outdated
Show resolved
Hide resolved
...hab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/AbstractMQTTDiscovery.java
Outdated
Show resolved
Hide resolved
...hab.binding.mqtt/src/main/java/org/openhab/binding/mqtt/discovery/AbstractMQTTDiscovery.java
Outdated
Show resolved
Hide resolved
...b.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/MqttBrokerHandlerFactory.java
Outdated
Show resolved
Hide resolved
...b.binding.mqtt/src/main/java/org/openhab/binding/mqtt/internal/MqttBrokerHandlerFactory.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PING! |
PING!! |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/oh3-mqtt-somtimes-issues-after-starting/113104/19 |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/broken-homeassistant-mqtt-discovery/125102/9 |
LGTM As Code owner for mqtt.espmilighthub this has been a minor annoyance in the logs but have not seen any issues. From the description of this, it may be increasing system load if a listener can get subscribed multiple times, so thanks for making the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @andrewfg!
…ady subscribed (openhab#10566) * [mqqt] do not allow unsubscribe unless already subscribed Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
…ady subscribed (openhab#10566) * [mqqt] do not allow unsubscribe unless already subscribed Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
…ady subscribed (openhab#10566) * [mqqt] do not allow unsubscribe unless already subscribed Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch> Signed-off-by: Dave J Schoepel <dave@theschoepels.com>
…ady subscribed (openhab#10566) * [mqqt] do not allow unsubscribe unless already subscribed Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
The MQTT AbstractBrokerHandler produces erroneous logger warnings when OH is being shutdown for the EspMilight, HomeAssistant, and Homie, discovery services. See #10562
I think that the problem is because of some or all of the following issues:
getDiscoveryService().unsubscribe()
although it might not already have calledgetDiscoveryService().subscribe()
.Signed-off-by: Andrew Fiddian-Green software@whitebear.ch