[mythtv] [mythtv-commits] Ticket #4381: Using a Miscellaneous Status Information (see ticket #4049) makes mythbackend segfault occasionnally...

Michael T. Dean mtdean at thirdcontact.com
Mon Jan 14 03:57:26 UTC 2008


On 01/13/2008 09:23 PM, MythTV wrote:
> #4381: Using a Miscellaneous Status Information (see ticket #4049) makes
> mythbackend segfault occasionnally...
...
>  It would be nice to eventually give back to mythbackend control over
>  misbehaving programs (in the form of a timeout) but as far as I am
>  concerned this fix gets the job done.
>   

Since the HTTP request is being processed in its own thread, if the 
miscellaneous status script takes a long time to execute, it's only that 
one thread that will wait.  So, basically the only difference is that 
the request for the backend status will wait for the information.  In 
other words, the lack of a timeout simply affects when the status page 
is returned--it has no other effects on mythbackend.

So, to get control (of your browser--the only thing really "out of 
control") back, simply hit the stop button on your browser, fix the 
script, and you're good.  If you happen to write a script with an 
infinite loop, just fix it and restart the backend to ensure any extra 
threads are killed.  Since these scripts aren't really something that 
people will edit frequently (i.e. set it up once and use it forever) and 
since it makes a /lot/ of sense to test any script you write at the 
command line before asking a production Myth box to run it, even these 
"worst case" scenarios are not that likely and, especially, not 
something that will occur frequently.

Besides, to put a timeout in, I'd just start a new thread to execute the 
script, so--although the thread that's processing the status page will 
give up eventually so it can return quickly--we'll still have a 
"runaway" thread running the whole script.  At least without the 
timeout, it's clear when the problem is a poorly-written script (no 
status page = bad script, status page with no information = bad program 
name/missing script).

Mike


More information about the mythtv-dev mailing list