openhab-addons: [pushover] Sending messages randomly fails with java.io.EOFException
Expected Behavior
Pushover messages should be reliable. Every attempt of sending a message from a rule should bring the same result.
Current Behavior
Very randomly and for no good reason the following error message appears in the logs and no pushover message is sent:
Script execution of rule with UID 'hm-sonstige-5' failed: java.io.EOFException: HttpConnectionOverHTTP@d761b68::DecryptedEndPoint@3b78ddb9{api.pushover.net/104.20.125.71:443<->/192.168.178.2:47218,OPEN,fill=-,flush=F,to=82112373/0} in hm-sonstige
Seconds later the exact same rule works like a charm for multiple times.
Steps to Reproduce (for Bugs)
Send a pushover message from the same rule multiple times.
Your Environment
- Version used: openHAB 3.1.0.M2
- Operating System and version: Synology Docker Container
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 62 (41 by maintainers)
There is no relation, idletimeout and timeout control different parts without overlap.
I’ll come back to this. Bit busy these days.
It took me a while to get it fixed.
The EOF is caused by the httpclient while sending the request. The underlying connection seems no longer to be available, but the httpclient is not aware. The connection might be killed by anything in between the httpclient and the remote server (including the remote server self, firewall, routers, anything)
As of HTTP 1.1 the connection is kept alive by default. The Jetty client can be manipulated to control the idle time by setting
httpClient.setIdleTimeout();As it failed reproducable after 5 minutes, i set the idletimeout to a shorter time, i just choose 18 seconds, but it might also work with 3 minutes or any other value < 5 minutes. Pushover binding does not use a periodic call, so i could not choose this interval + some offeset. The binding sends messagtes ad-hoc, so i assumed most messages are send close together or with some longer time in between. I do not care that much about the exact value as there is little to no advantage to stretch this value to the max.The thought behind this is that the httpclient does know when the idle timeout occurs and it handles it transparantly. As long as this timeout triggers before the ‘remote connection kill’ event is happening, it all works.
BTW: i ruled out the other bindings by first trying to use
httpClientFactory.createHttpClient("binding.pushover");but that did not help at all. You can see that in the commit history.Hope this explains it enough to merge the request.
Nice! I have updated the jar again. Would be nice if you can test once more. I did some cleanup and had a closer look at the documentation so it should still work, but with less code change.
Updated the JAR, now it includes some more timeout restrictions. Curious if that makes a difference. most of them are set around 2 minute mark.
Hi! I ran into the same Problem! Some messages went out and some not. What i saw is that after a fresh reboot every message went out. But after some time when no message was sent the next message generates an EOF Exception. I observed this after i got a new Cable Modem from my Internet Provider. So i started to dig deeper. What i found out:
Workaround: Triggering a “Sent Message” with Empty Content every couple of Minutes will generate some “Keepalive” Traffic on the established Connection and my Cable Modem is not Dropping the Connection!
Is it possible to implement some sort of Keepalive in the Binding or a check if an established TCP Session is “healthy”?