-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Losing events on REST API (atmosphere) #765
Comments
Do you see a message like '16:17:05.292 DEBUG o.o.i.r.i.b.GeneralBroadcaster[:41] - broadcaster 'org.openhab.io.rest.internal.broadcaster.GeneralBroadcaster$1@5507f60' is empty' right before the one you specified in your log? |
No, I don't see it on logs. Here is a little more log: 00:01:56.844 WARN o.a.cpr.DefaultBroadcaster[:500]- This message Entry{message=Garagem (Type=SwitchItem, State=OFF), type=ALL, future=org.atmosphere.cpr.BroadcasterFuture@33d1d377} will be lost The log's settings are at defaults. Do I have to change any settings to enable more debug info on logs? Thanks. |
Hi again! Looking at other issues, I found issue 673 to be almost the same: |
Hi, |
I use libcurl for the request. Here I setup the headers:
The URL is defined here:
where i->link is: http://192.168.25.26:8080/rest/items/Garagem When the item gets updated, my handle function uses libxml to parse the status change (but this function is never called when the lost event happens):
Please let me know if you need more information. Thanks |
Ok, seems that openHab doesn't know how to answer your request. The "accept" HTTP header is missing. |
@oliver-M, thank you. After adding the http header "Accept: application/xml" no events was lost anymore. I'm still having other issues with 1.4 but I'll post on another topic. Thanks again! |
Unfortunately the lost events issue persist. I updated OH 1.4 to build 594 and I'm sending the header "Accept: application/xml", but I'm still losing events: 15:17:15.625 WARN o.a.cpr.DefaultBroadcaster[:500]- This message Entry{message=HomeCentral (Type=SwitchItem, State=ON), type=ALL, future=org.atmosphere.cpr. Which debug should I enable to help hunt this bug? Thanks |
I just tried to investigate this problem. It seems to be a problem with the streaming transport, when I use long-polling I get proper updates of the items. Please verify by comparing the results of these two queries: curl --header "X-Atmosphere-Transport: long-polling" --header "Accept: application/json" http://192.168.25.26:8080/rest/items/Garagem curl --header "X-Atmosphere-Transport: streaming" --header "Accept: application/json" http://192.168.25.26:8080/rest/items/Garagem From my point of view this has nothing to do with the DefaultBroadcasters losing events log entries. There is rather some mistake in generating the response in streaming transport mode. |
I will try to reproduce your findings.. |
I upgraded the atmosphere libs to the current version 2.1.1 and the streaming transport seems to be working again. Maybe you could test this against your setup, you can find my clone here: There is one problem that needs to be resolved before I can create a pull request: During start I get the following exception for all rest-based addons (cometvisu and rest): As the required libraries are included I don´t know how to solve this and it seems to have no impact on the functionality. |
Could you try to add the launch parameter "-da“ and see if the error disappears? Regards, |
The -da parameter does not help. ERROR o.a.cpr.AtmosphereFramework[:2306] - And the source code in AnnotationDetector is (lines 330-353): Regards, Am 29.03.2014 18:27, schrieb kaikreuzer:
|
Probably best to ask for help in the Atmosphere support list? Am 29.03.2014 um 18:48 schrieb peuter [email protected]:
|
It seems if someone did that already: And an issue is filed for this problem too: Am 29.03.2014 18:54, schrieb kaikreuzer:
|
Hi @digitaldan, any news on your post (mentioned in #1126) in the atmosphere forum? Could you please refer to your thread there? Best, Thomas E.-E. |
at all … we seem to still have the problem with this issue. Can anybody of the Atmosphere specialist (@digitaldan @oliver-M) please help out? Since i am currently preparing a 1.6.2 Bugfix Release it would be REALLY great to have a solution for this critical issue. Any help is greatly appreciated! Best, Thomas E.-E. /cc @jochenkluger |
Hi, |
Hi, the CacheEntry entry = ResourceStateChangeListener.getCachedEntries().get(clientId); I assume this should be |
And if somebody make a pull request, would be nice to add the stacktrace to the logger output, i.e. |
@dominicdesu , sorry that was my error, I added that null check to prevent the message, although its still acting the same as it did before. I'll fix that now, but while that error message may be related to this issue, its not the cause, so I don't think avoiding it will solve anything. |
thanks, that would be really great! |
@digitaldan another weekend approaching … hopefully with fresh eyes ;-) Thanks, Thomas E.-E. |
Yes, I'm looking at it again ;-) The heap dumps were very useful, thanks On Fri, Jan 16, 2015 at 3:06 PM, Thomas Eichstädt-Engelen <
|
thanks @digitaldan … i am a bit unsure whether to wait for this for 1.6.2. Any clue what the solution will look like? Any suggestions timing wise? |
I don't, it's tough, I run 4 android clients connected all the time as On Mon, Jan 19, 2015 at 6:29 AM, Thomas Eichstädt-Engelen <
|
Hi, if it helps, I could provide a Windows app that reproduces this behaviour in every setup I tested or I could provider the JavaScript code that is used behind the Client. Or is there anything else I can do to help? Jochen Von: Dan [email protected] I don't, it's tough, I run 4 android clients connected all the time as On Mon, Jan 19, 2015 at 6:29 AM, Thomas Eichstädt-Engelen <
Reply to this email directly or view it on GitHubhttps://github.com//issues/765#issuecomment-70500870. |
@digitaldan - I am currently seeing this on my relatively simple OpenHAB 1.5.1 setup. No more than 50 items, 1 minute logging using RRD, charting using default charting engine, a few rules... running on Raspberry Pi B+. If you want to poke around, or get some logs, I would be happy to assist getting this nasty bug squashed. |
Hi! I don't see any good or minimal solution here. The best solution in my eyes would be to write an own BroadcasterCache, like the UUIDBroadcasterCache. That can can save the sent messages not just in a list but in something like a ring buffer. For old clients, everything works like before. Clients, which reconnect with a header "X-my-last-msg-id" will be handled in a new way: They'll get the lose message because now the server now have the information, where the clients is and what he missed. The limit of this method is the size of the ring buffer. I would suggest, we use a default size of 32 messages. That should be enough for small reconnects. If the client says, 'my last messages was nr. 1' and the oldest message in the buffer has id 100, we have to answer something like 'reload everything'. That should be solved with the status code like 416 or just 400. Does that make sense? Is that change possible to implement for iOS and Android? I'm just a web guy. :-) |
Is this bug present on OH 1.7.0 too ? |
I think so. At least I have naver had those errors anymore. []'s 2015-07-16 13:36 GMT-03:00 Testato [email protected]:
|
since no real solution could be found over the past months i tend to leave this issue open and wait for the new OH2 to come (which removes Atmosphere completely). Any other suggestions? |
@teichsta Does this mean we should label this issue as wont-fix? |
I have some spare time next week. Maybe I can spent some time to find a regards
|
any news @oliver-M? If not i would tend indeed to close this issue as wont-fix |
as explained above … since the expertise for atmosphere is very rare we shouldn't too much efforts anymore. Thanks to all participating, discussing, helping on this issue! |
Maybe wiki could contain "known issues" where this kind of behaviors are documented |
Hi guys!
I have built myself a microcontrolled hardware to automate my home and I'm using openhab as a interface.
The server talks with all the controllers via RS-485 and since I don't program in Java, I've made a C program to talk via rs485 with the hardware and via REST API with OpenHab.
Everything is working perfectly with OH 1.3.1 but not with OH 1.4.
With 1.4, I'm losting a lot of events (ex: I change a switch item via HABDroid my C application doesn't receive the update).
For polling the items, I'm using HTTP Header "X-Atmosphere-Transport: streaming".
Every time I lost an event, OH outputs the following on LOG:
00:01:56.844 WARN o.a.cpr.DefaultBroadcaster[:500]- This message Entry{message=Garagem (Type=SwitchItem, State=OFF), type=ALL, future=org.atmosphere.cpr.BroadcasterFuture@33d1d377} will be lost
Let me know if you need for information.
Thanks
Renato
The text was updated successfully, but these errors were encountered: