Error on API after upgrade to 1.7
Re: Error on API after upgrade to 1.7
Yes it's definetly 1.7.0 version. Since I revert back in 1.5.0 I have no error (in version 1.7.0 I have already had several errors)
Re: Error on API after upgrade to 1.7
If you don't explicitly pass Connection header, it is assumed "keep-alive" for HTTP 1.1.
Try to add "Connection: close" header and see if there's any difference.
Try to add "Connection: close" header and see if there's any difference.
Re: Error on API after upgrade to 1.7
I add this option to curl :
curl_setopt($ch, CURLOPT_FORBID_REUSE, true);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
According to documention CURLOPT_FORBID_REUSE send explicitly close conneciton header :
TRUE to force the connection to explicitly close when it has finished processing, and not be pooled for reuse.
And close CURLOPT_FRESH_CONNECT force to refresh connection :
TRUE to force the use of a new connection instead of a cached one.
Link to doc : http://www.php.net/manual/en/function.curl-setopt.php
So now I force connection to close.
I come back to you within 24 hours to say whether this is good or not
curl_setopt($ch, CURLOPT_FORBID_REUSE, true);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
According to documention CURLOPT_FORBID_REUSE send explicitly close conneciton header :
TRUE to force the connection to explicitly close when it has finished processing, and not be pooled for reuse.
And close CURLOPT_FRESH_CONNECT force to refresh connection :
TRUE to force the use of a new connection instead of a cached one.
Link to doc : http://www.php.net/manual/en/function.curl-setopt.php
So now I force connection to close.
I come back to you within 24 hours to say whether this is good or not
Re: Error on API after upgrade to 1.7
Same issue event if I close connection explicitly. And error his due to 1.7 version because if I revert back to 1.5.0rc-3 error disappear.
Re: Error on API after upgrade to 1.7
No, it closes the connection, but doesn't send close connection header. You should add the header manually with CURLOPT_HEADER.zoic22 wrote:According to documention CURLOPT_FORBID_REUSE send explicitly close conneciton header :
TRUE to force the connection to explicitly close when it has finished processing, and not be pooled for reuse.
Re: Error on API after upgrade to 1.7
Ok I add a custom header in my request :
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close'));
Now I properly close connection. I will wait 24 hours to see if the error occure again.
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close'));
Now I properly close connection. I will wait 24 hours to see if the error occure again.
Re: Error on API after upgrade to 1.7
Same error this night. So "close connection" is not enough or the problem is elsewhere.
Re: Error on API after upgrade to 1.7
There were no other changes in http server part since 1.5.
How frequent are your requests? API requests are not concurrent. It usually takes about 120ms per request on my Mac, on Raspberry it might take even longer. If you have like 5 (I've seen 3 in your previous log) requests at a time, no wonder the last one might take longer than a second.
Also, version 1.5 and 1.7 have different versions of Home Automation bundled, and 1.7 HA might be heavier than 1.5.
For a clean experiment remove everything in "automation" folder, just leave an empty main.js there.
How frequent are your requests? API requests are not concurrent. It usually takes about 120ms per request on my Mac, on Raspberry it might take even longer. If you have like 5 (I've seen 3 in your previous log) requests at a time, no wonder the last one might take longer than a second.
Also, version 1.5 and 1.7 have different versions of Home Automation bundled, and 1.7 HA might be heavier than 1.5.
For a clean experiment remove everything in "automation" folder, just leave an empty main.js there.
Re: Error on API after upgrade to 1.7
I request very frequently api but max 3 request at time and not more than in 1.5.
I juste clean auotomation folder to see if it change somethink.
It should be noted that even when the situation seems to be a little better since the addition of the "close connection" but I still have errors.
I juste clean auotomation folder to see if it change somethink.
It should be noted that even when the situation seems to be a little better since the addition of the "close connection" but I still have errors.
Re: Error on API after upgrade to 1.7
Very frequent requests sometimes may take more time because of garbage collection. We changed the version of v8 engine between 1.5 and 1.7, so garbage collection policy might have been changed as well.
Why do you need so many requests to the api? I believe there's more efficient way without wasting resources.
Polling might be really useful only for data values, and using /ZWaveAPI/Data/ for incremental data updates is much more efficient than constantly requesting each data holder thru /ZWaveAPI/Run/devices[x].instances[y].commandClasses[z].data.abc.value. And it is not only network efficient, but also memory and resources efficient, as it doesn't involve v8 to collect changed data.
Why do you need so many requests to the api? I believe there's more efficient way without wasting resources.
Polling might be really useful only for data values, and using /ZWaveAPI/Data/ for incremental data updates is much more efficient than constantly requesting each data holder thru /ZWaveAPI/Run/devices[x].instances[y].commandClasses[z].data.abc.value. And it is not only network efficient, but also memory and resources efficient, as it doesn't involve v8 to collect changed data.