Page 2 of 2
Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8 **solved**
Posted: Wed Aug 28, 2019 7:51 pm
by SANdood
Turns out that I can specify the timeout on Hubitat - will try that to see if it makes it easier for me to catch and handle the timeout...
Still, would like a valid HTTP Response Status instead of an empty string...
Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8
Posted: Wed Aug 28, 2019 10:28 pm
by staze
I wonder why we'd enter this state at all... why is MB suddenly unable to, seemingly reliably, respond to these requests after some number of hours...
Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8
Posted: Wed Aug 28, 2019 10:51 pm
by SANdood
@staze -
On my own MeteoBridge, I have 21 different uploads showing on my Live Data tab. In addition, I have 8 different FTP/HTML push items on my Services page. And 4 different local systems (ST, HE and rPi) each making template CGI requests every 1-2 minutes. All this on the relatively beastly TL-MR3020v3 platform.
From running my code, you know that it is taking 4-8 seconds for the MB to respond to the (optimized) HE template request (the original could take as long as 15 seconds to generate a response).
Although I don't believe that the MeteoBridge is single-threaded, 33 requests each taking 8+ seconds eventually has multiple requests being handled simultaneously, and apparently a large percentage of those have to go through the CGI Template responder. At some point something has to give...
Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8
Posted: Wed Aug 28, 2019 11:51 pm
by admin
Just released update gives a 503/504 return code, if template evaluation does not work for any reason.
Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8 **solved**
Posted: Thu Aug 29, 2019 12:28 am
by SANdood
AWESOME! Installing the update now.
I have extended the timeout to 20 seconds, and my code already checks for non-200 Status, so this should be easy to monitor. Hopefully, by not hitting the Hubitat timeout, things won't form the Read timeout log-jam any more...
I'll keep you posted, and THANKS SO MUCH!!!
Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8
Posted: Thu Aug 29, 2019 12:49 am
by staze
SANdood wrote: Wed Aug 28, 2019 10:51 pm
@staze -
Although I don't believe that the MeteoBridge is single-threaded, 33 requests each taking 8+ seconds eventually has multiple requests being handled simultaneously, and apparently a large percentage of those have to go through the CGI Template responder. At some point something has to give...
Totally. That said, my MB Nano should only have it's uploads, and just my Hubitat asking for template. I guess I'm unsure how the requests could be backing up at all (as mentioned, how they're continuing to fail once they start failing). =/
Could some variable on the MB be being set once that "null" is returned that causes it to just fail from then on out?
Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8 **solved**
Posted: Thu Aug 29, 2019 1:47 pm
by SANdood
New version of MB now with 3 template.cgi requestors every 60 seconds is running extremely well - I think the extended timeout on my side plus the new error responses from MB combine for a significant improvement.
My updated MeteoBridge Weather Station for SmartThings & Hubitat is available here:
https://raw.githubusercontent.com/SANdo ... ion.groovy
Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8
Posted: Thu Aug 29, 2019 1:50 pm
by SANdood
admin wrote: Wed Aug 28, 2019 11:51 pm
Just released update gives a 503/504 return code, if template evaluation does not work for any reason.
Is there a difference in the meaning between a 503 and a 504 Response Status?
Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8 **solved**
Posted: Sat Aug 31, 2019 11:35 am
by admin
504 is a time out, 503 indicates that operation cannot be started at all.
Re: Template causes MB lockup on 3.9 & 4.0 - works fine on 3.8 **solved**
Posted: Sat Aug 31, 2019 6:38 pm
by staze
Been up and running consistently (no reboots on either end) for several days now. Haven't seen a single 50x error.
Thanks Boris for making this change! =)