-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
Fix dangling SSE subscriptions #2983
Conversation
Unlike the sitemap SSE subscriptions generic event subscriptions did not implement a connection lost monitor. Signed-off-by: Jan N. Klug <github@klug.nrw>
Is it for sitemap SSE? Edit: undersood, it is not for sitemap SSE. |
@J-N-K Any event that can't be mapped to the corresponding python type will generate an error in the logs (every time it is received). |
I think about MainUI and the remote openHAB binding as other users of the OH SSE. To be checked if they will not be impacted. |
@lolodomo Can you check for the remoteopenhab-binding? I have not seen issues in Main UI, but I‘ll check again. |
I have the same question as @spacemanspiff2007 : under which topic is the published? |
Hre are the topics "listened" by the remote openHAB binding: openhab/items//,openhab/things//,openhab/channels//triggered,openhab/channels//descriptionchanged |
There is no topic. It's just '{ "TYPE" : "ALIVE" }', similar to the alive-event from the sitemap (which contains some additional information about the sitemap not needed here). |
Do I have to respond to this item with a rest call in any way? |
No, the only reason is to detect a closed TCP connection (then the send will fail and the listener removed). |
@J-N-K : for the remote openHAB binding I believe this would require a simple additional case to cover the type ALIVE here: |
If we change nothing, the only risk is to have regular DEBUG logs mentioning ALIVE type messages not supported. |
Wouldn't it only be necessary to send this some time after the last message was sent? |
Technically yes, but that would require tracking which event made it to which subscription. Just keeping track of the last processed event globally is not sufficient, because of the filter it'll not reach all subscribers. IMO the burden of one extra event every 2 minutes does not justify more complex logic here. |
No worries - I thought the filters are connection bound and the connection knows when it's sending an event. |
Signed-off-by: Jan N. Klug <github@klug.nrw>
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 for the fix!
This is confirmed.
I will have to propose a small update. |
Related to openhab/openhab-core#2983 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Just for my curiosity: all OH SSE events have "message" as name while your ALIVE event has "event". Is it expected? Line 54 in cdf876c
|
Related to openhab/openhab-core#2983 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
…3008) Related to openhab/openhab-core#2983 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
…3008) Related to openhab/openhab-core#2983 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
…3008) Related to openhab/openhab-core#2983 Signed-off-by: Laurent Garnier <lg.hc@free.fr> Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
…3008) Related to openhab/openhab-core#2983 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
…3008) Related to openhab/openhab-core#2983 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Unlike the sitemap SSE subscriptions generic event subscriptions did not implement a connection lost monitor. Signed-off-by: Jan N. Klug <github@klug.nrw> GitOrigin-RevId: 84d5d38
Fixes #598
Unlike the sitemap SSE subscriptions generic event subscriptions did not implement a connection lost monitor.
@spacemanspiff2007 Can you confirm that this additional event does not cause issues in your application?
Signed-off-by: Jan N. Klug github@klug.nrw