Open mhilbush opened 6 years ago
@lolodomo and @resetnow Could you please check that? At least this seems to be the first time that the bug is reproducible.
I was unable to reproduce it but I have only Android 5 devices.
Thanks for trying. Once I have updated my openHAB to include your fix, I give it a try with my Lineage 14.1 (Android 7.1.2) device.
Once I have updated my openHAB to include your fix, I give it a try
Just to clarify, you don't need @lolodomo's PR to reproduce the problem. His PR provides a workaround that periodically frees up the orphaned subscriptions. You might already know that, but it wasn't obvious from your comment above.
My test results:
openhab> bundle:list | grep Sitemap
115 │ Active │ 80 │ 0.10.0.201807241640 │ Eclipse SmartHome Sitemap REST
Android 7.1.2 using Chrome browser
2018-07-27 10:45:58.598 [DEBUG] [t.sitemap.SitemapSubscriptionService] - Created new subscription with id 0453e2cf-bef3-4b2a-888b-ad41f0c1bb4b (2 active subscriptions for a max of 50)
2018-07-27 10:45:58.605 [DEBUG] [est.sitemap.internal.SitemapResource] - Client from IP 192.168.42.30 requested new subscription => got id 0453e2cf-bef3-4b2a-888b-ad41f0c1bb4b.
2018-07-27 10:45:58.780 [DEBUG] [t.sitemap.SitemapSubscriptionService] - Subscription 0453e2cf-bef3-4b2a-888b-ad41f0c1bb4b changed to page stefan of sitemap stefan (2 active subscriptions}
2018-07-27 10:45:58.789 [DEBUG] [est.sitemap.internal.SitemapResource] - Client from IP 192.168.42.30 requested sitemap event stream for subscription 0453e2cf-bef3-4b2a-888b-ad41f0c1bb4b.
2018-07-27 10:49:32.904 [DEBUG] [est.sitemap.internal.SitemapResource] - Run clean SSE subscriptions job
2018-07-27 10:49:32.922 [DEBUG] [.sitemap.internal.SitemapEventOutput] - Sent alive event to subscription c1bb839c-4548-46d6-a549-505e36c45f91.
2018-07-27 10:49:32.927 [DEBUG] [.sitemap.internal.SitemapEventOutput] - Sent alive event to subscription 0453e2cf-bef3-4b2a-888b-ad41f0c1bb4b.
2018-07-27 10:53:53.295 [DEBUG] [.sitemap.internal.SitemapEventOutput] - Sent sitemap event for widget 0106 to subscription c1bb839c-4548-46d6-a549-505e36c45f91.
2018-07-27 10:53:53.310 [DEBUG] [.sitemap.internal.SitemapEventOutput] - Sent sitemap event for widget 0106 to subscription 0453e2cf-bef3-4b2a-888b-ad41f0c1bb4b.
2018-07-27 10:53:53.324 [DEBUG] [est.sitemap.internal.SitemapResource] - SSE connection for subscription c1bb839c-4548-46d6-a549-505e36c45f91 has been closed.
2018-07-27 10:53:53.327 [DEBUG] [t.sitemap.SitemapSubscriptionService] - Removed subscription with id c1bb839c-4548-46d6-a549-505e36c45f91 (1 active subscriptions)
2018-07-27 10:53:53.339 [DEBUG] [.sitemap.internal.SitemapEventOutput] - Sent sitemap event for widget 0104 to subscription 0453e2cf-bef3-4b2a-888b-ad41f0c1bb4b.
2018-07-27 10:54:32.904 [DEBUG] [est.sitemap.internal.SitemapResource] - Run clean SSE subscriptions job
2018-07-27 10:54:32.911 [DEBUG] [.sitemap.internal.SitemapEventOutput] - Sent alive event to subscription 0453e2cf-bef3-4b2a-888b-ad41f0c1bb4b.
Android 8.1.0 using Chrome browser
2018-07-27 10:57:24.190 [DEBUG] [t.sitemap.SitemapSubscriptionService] - Created new subscription with id 11ff1580-f9c7-4272-a9bd-2e431e6f1f08 (2 active subscriptions for a max of 50)
2018-07-27 10:57:24.196 [DEBUG] [est.sitemap.internal.SitemapResource] - Client from IP 192.168.42.25 requested new subscription => got id 11ff1580-f9c7-4272-a9bd-2e431e6f1f08.
2018-07-27 10:57:24.250 [DEBUG] [t.sitemap.SitemapSubscriptionService] - Subscription 11ff1580-f9c7-4272-a9bd-2e431e6f1f08 changed to page stefan of sitemap stefan (2 active subscriptions}
2018-07-27 10:57:24.254 [DEBUG] [est.sitemap.internal.SitemapResource] - Client from IP 192.168.42.25 requested sitemap event stream for subscription 11ff1580-f9c7-4272-a9bd-2e431e6f1f08.
2018-07-27 10:59:32.904 [DEBUG] [est.sitemap.internal.SitemapResource] - Run clean SSE subscriptions job
2018-07-27 10:59:32.910 [DEBUG] [est.sitemap.internal.SitemapResource] - SSE connection for subscription 0453e2cf-bef3-4b2a-888b-ad41f0c1bb4b has been closed.
2018-07-27 10:59:32.913 [DEBUG] [t.sitemap.SitemapSubscriptionService] - Removed subscription with id 0453e2cf-bef3-4b2a-888b-ad41f0c1bb4b (1 active subscriptions)
2018-07-27 10:59:32.921 [DEBUG] [.sitemap.internal.SitemapEventOutput] - Sent alive event to subscription 11ff1580-f9c7-4272-a9bd-2e431e6f1f08.
2018-07-27 11:03:53.525 [DEBUG] [.sitemap.internal.SitemapEventOutput] - Sent sitemap event for widget 0103 to subscription 11ff1580-f9c7-4272-a9bd-2e431e6f1f08.
2018-07-27 11:04:32.904 [DEBUG] [est.sitemap.internal.SitemapResource] - Run clean SSE subscriptions job
2018-07-27 11:04:32.911 [DEBUG] [.sitemap.internal.SitemapEventOutput] - Sent alive event to subscription 11ff1580-f9c7-4272-a9bd-2e431e6f1f08.
So no suspicious re-creating of subscriptions...
EDIT: I opened the main page and left it open for around 10minutes
Thanks for trying to reproduce. Right after you opened the main page, did you lock the phone using the power button?
Somehow I knew this was going to be one of those problems... I'll continue to try to determine what setting(s) is causing this behavior.
One thing I noticed in my most recent test (and I can't say that I've observed this in every test) is that the flurry of subscription requests occurred precisely when the phone made a notification sound. I had turned off notifications to the display. Maybe I'll try turning off notifications altogether.
Right after you opened the main page, did you lock the phone using the power button?
Yes thats what I did. And then I left it like that for about 10 minutes.
I am also witnessing "SSE subscription failed: running in fallback mode" on Windows 10 (1809) with Chrome (build 69) simply accessing the Basic UI.
Same here with Chrome Version 70.0.3538.110 on Windows 10 - using BasicUI with openHAB v2.4.0~M8-1.
I've observed this behavior on an Android phone while the phone is locked/asleep. There is at least one other report of this happening on iPhone and Mac as reported in this forum post.
I've recreated the issue with Chrome and Firefox on Android v8.1.0 (on a Pixel 2 XL).
This issue would result in the system reaching the max subscriptions, which would cause BasicUI to display the message
SSE subscription failed: running in fallback mode
. Prior to PR #5910, these subscriptions would never be released.Below is an example of the problem using Firefox. While the phone is locked/asleep, subscriptions are created every several milliseconds. Additional information and discussion is in issue #4809.
I've experimented with various lock/sleep settings; however, so far I've found no combination of settings that makes the problem go away.
Phone was locked by pressing the power button.