Page 76 of 84 FirstFirst ... 26667475767778 ... LastLast
Results 1,126 to 1,140 of 1248

Thread: TivoWebPlus 2.1 Testing and Development

  1. #1126
    Join Date
    Dec 2006
    Posts
    55

    Fix for "too many open files"

    Quote Originally Posted by IcedTivo View Post
    I'm getting this error frequently almost daily. [...] restart/full often works to fix but sometimes have to reboot.

    -------INTERNAL SERVER ERROR------ --cut here--POSIX EMFILE {too many open files}
    couldn't open "/TivoWebPlus/themes/.common.css": too many open files
    while executing
    "open $fnam "r""
    (procedure "serve_file" line 31)
    invoked from: "serve_file $chan $path $env $ext $head_req $mod_since"
    (procedure "doSession" line 100)
    invoked from: "doSession $chan $addr $port"
    --cut here--
    TiVo (well my Series 1 at least!) can only handle ('scuse the pun ) 256 open files.

    There's a bug in the TWP file server (serve_file{}) which means it opens file handles but doesn't always close them again (e.g. when replying with a 304).

    The fix for this is to modify libs/http.itcl as follows:

    Code:
    --- S:/tivowebplus-v2.1.b3-110622/TivoWebPlus/libs/http.itcl	Tue Jun 21 22:59:12 2011
    +++ T:/tivowebplus-v2.1.b3-110622/TivoWebPlus/libs/http.itcl	Sat Jul 21 13:39:40 2012
    @@ -135,9 +135,9 @@
           }
         } } ] { return 404 }
       }
    -  if { $mod_since == $moddate } { return 304 }
    +  if { $mod_since == $moddate } { catch {close $fd}; return 304 }
       print_html_header_200 $chan $mime $moddate
    -  if { $head_req == 1 } { return 0 }
    +  if { $head_req == 1 } { catch {close $fd}; return 0 }
       if { $image } {
         fconfigure $chan -translation binary
       }
    Attached Files Attached Files
    Tivo since 2002. UK S1 + 1TB SATA. ex-TAM (tenner a month). Virgin Media not available here.

  2. #1127
    Join Date
    Mar 2005
    Posts
    233

    tivowebplus-v2.1.b3-20120803

    Here is an updated bundle. It includes patches from this thread since the previos bundle was released by John1980 (from post 1060 through 1126). Specifically it includes patches from 1070, 1077, 1078, 1091, 1094, 1114, 1124, and 1126. Those patches also supercede 1060, 1075, 1076, 1092, 1097, and 1107. I removed the get_space binaries and sources. I update the distribution name and checksums. Feel free to point out anything I missed and please post future patches against this distribution (unless there are any objections).

    Here's a quick cheat sheet for the included/superceded patches:
    Code:
    CURRENT
    1070 - spitfires - Speed improvements in index.itcl
    1077 - jkozee    - update to get_space_tcl
    1078 - spitfires - New blocklist module (replaces 1076, 1060)
    1091 - djl       - Leap year fix for log files
    1094 - djl       - Add iCal to todofeed
    1114 - spitfires - tivoweb stop fix
    1124 - spitfires - Bug fix for ForeachMfsFileTrans (replaces 1107, 1097, 1092, 1075)
    1126 - spitfires - Bug fix for "too many open files"
    1128 - jkozee   - Seasonpass patch
    
    SUPERCEDED
    1060 - ktoyax    - Row format changes - Superceded by 1076
    1075 - spitfires - fix for can't read "x": no such variable - Superceded by 1107
    1076 - spitfires - replacement for 1060 that is S1 friendly - Superceded by 1078
    1092 - spitfires - Fix for multiple deletes - Superceded by 1097
    1097 - spitfires - Bugfix for errTmActiveLockConflict - Superceded by 1107
    1107 - spitfires - Fix for errTmActiveLockConflict - Superceded by 1124
    This bundle has been superceded by this post.
    Attached Files Attached Files
    Last edited by jkozee; 01-13-2013 at 01:32 PM.

  3. #1128
    Join Date
    Mar 2005
    Posts
    233
    Well that distribution didn't last long.

    Here's a patch that fixes the "Error: your season pass priority list is corrupted, reorganizing them from the tivo UI may help" seen on the seasonpass menu. Looks like a bug was introduced when the OzTivo widget support was added a few years ago. I updated the previous post/distribution to include this fix as well.
    Attached Files Attached Files

  4. #1129
    Join Date
    Dec 2006
    Posts
    55

    Lock-ups

    Did anyone ever have any luck with diagnosing the TWP runaway when interrupting a page display? The condition I mean is:
    1) Display a nice long page - e.g. Now Playing or ToDo
    2) *While it's loading* click on a link - e.g. a programme title (with a view to displaying the Showing screen)

    Result = TWP now locks up and you're left "waiting for 192.168.1.200...". If you look on the Tivo, TWP is still running but is churning away just running up mill time (e.g. 85% CPU 21% MEM). Can't interrupt it, can't stop it - only way out is to reboot Tivo.

    You're ok if you Ctrl & click to load on another browser tab - it seems to be only if you load into the same tab.


    I tried various things:

    I thought maybe it was because the channel was no longer available (once you abort/interrupt the page load) so "puts $chan" is blocking, but that doesn't seem to be it - all connections have the same channel id.

    I tried making TWP only accept 1 request at a time - no effect.

    I even tried making the http socket non-blocking but that caused issues elsewhere and didn't help anyway!

    It doesn't seem to do it with all screens and I'm thinking it only happens if you interrupt TWP while it is doing some MFS work (e.g. it does it on NowPlaying, ToDo and SPs but not on Channel List). Quite why this should upset things I don't know - maybe "transaction" can't muti-thread?


    As I say it's not an issue if you request things on different tabs - they are simply queued up and processed in sequence. It's only if you interrupt a page load (by clicking on a link, or pressing Esc) that TWP barfs.


    This doesn't happen with tivoweb or TWP 1.3.1 so it's something in the way 2.1 is accessing the MFS? Maybe it's something to do with the way getrec() is using global vars? (that proc is serious spaghetti with not a comment nor usage note in sight!)

    But then again, it also happens if you simply press Esc during the page load, which suggests it's a socket issue.

    Thoughts anyone?
    Tivo since 2002. UK S1 + 1TB SATA. ex-TAM (tenner a month). Virgin Media not available here.

  5. #1130
    Join Date
    Mar 2005
    Posts
    233
    I have not seen this behavior and cannot reproduce it. I tried both title and eptitle during a NPL load. I also tried ESC. I tested with THD, IE8, and tivowebplus-v2.1.b3-20120803. What are you testing with?

  6. #1131
    Join Date
    Dec 2006
    Posts
    55
    Maybe it only does it on S1s? I've used FF11 & Chrome, on 2 separate TiVos (both S1, 1 with Turbonet, 1 with Cachecard) tivowebplus-v2.1.b3-110622 (+mods)

    Happens every time for me


    EDIT: also does it in IE8 when I press Esc (can't test by clicking on a link since IE doesn't display the page as it goes along)
    Last edited by spitfires; 08-03-2012 at 12:15 PM.

  7. #1132
    Join Date
    Mar 2005
    Posts
    233
    IE8 displays for me as the list is building. Can you verify that the last bundle I posted also does it (not that I expect otherwise, but since I don't have your bundle/patches to test). It could very well be something S1/swversion specific. There are plenty of branches based on "version".
    Last edited by jkozee; 08-03-2012 at 02:03 PM.

  8. #1133
    Join Date
    Dec 2006
    Posts
    55
    Yes it does the same with tivowebplus-v2.1.b3-20120803.tgz What version of TCL is on your Tivo? (I'm stuck with TCL 8.0, and s/w 2.5.5)

    My gut feel says it is to do with event manager - this changed after version 3 s/w I think?

  9. #1134
    Join Date
    Mar 2005
    Posts
    233
    IIRC THD is based on TCL 8.2. I don't have access to an S1, so I'm not sure how much help I will be.

    I assume by some of your patches and comments, you've already been through the ForeachMfsFile code. You mentioned that it works on TWP 1.3.1, does it also use ForeachMfsFile during those screens. Have you tried reverting to the stock mfslib.tcl version?

  10. #1135
    Join Date
    Dec 2006
    Posts
    55
    Thanks for your ideas. I need to try and localise the offending code a bit more - good idea on trying the stock mfslib.
    Tivo since 2002. UK S1 + 1TB SATA. ex-TAM (tenner a month). Virgin Media not available here.

  11. #1136
    Join Date
    Mar 2005
    Posts
    233
    I just had another thought about your lockups. How are you starting TWP when you experience problems? I vaguely remember having issues when I was creating/debugging code for get_space_tcl. IIRC, it was only when I start TWP interactively from the CL.

  12. #1137
    Join Date
    Dec 2006
    Posts
    55
    It happens however I start it - either rc.sysinit.author, CL or any of TWP's "Restart" options.


    p.s. there is a bug in the "tivoweb" start-up script which means if you start TWP using a relative dir (i.e. with "./TivoWebPlus/tivoweb &") then it will create spurious config files - this can be fixed as shown below - is that the issue you are referring to?
    Code:
    --- S:/TiVo/releases/2012-08-03/TivoWebPlus/tivoweb	Sat Aug 04 08:27:25 2012
    +++ S:/TiVo/tivo_testing/2012-07-23/TivoWebPlus21b3/tivoweb	Sat Jul 21 15:33:00 2012
    @@ -26,6 +26,9 @@
     bin=${dir}httpd-tt.tcl
     arc=`uname -m`
     
    +# [spitfires Jul 2012] - fix for relative paths causing spurious config directories to be created
    +dir=`cd $dir; pwd`/
    +
     [ -x ${dir}bin_$arc/setpri ] && ${dir}bin_$arc/setpri ts 0 $$
     
     # locate data dir... default to /var/TWP if necessary

  13. #1138
    Join Date
    Dec 2006
    Posts
    55
    It's amazing what a fresh cup of tea can do...

    D'oh! The problem was the nested catch block I introduced in #1107

    I've repaired that and also trapped the broken socket so that it aborts quicker (otherwise ForeachTrans would have pointlessly tried again with a smaller batch size).
    Attached Files Attached Files
    Tivo since 2002. UK S1 + 1TB SATA. ex-TAM (tenner a month). Virgin Media not available here.

  14. #1139
    Join Date
    Mar 2005
    Posts
    233
    Excellent. I will add the patches to the distribution, but probably wait a few days before releasing it. There are a few more things I want to look at.

    Oddly enough, I was finally able to reproduce your problem last night but was too tired to continue. I updated my distribution with a couple of other fixes and re-installed an it started happening. I wonder if I was inadverntly testing with John1980's bundle when I couldn't reproduce it. Maybe I should have had a fresh cup yesterday...

  15. #1140
    Join Date
    Dec 2006
    Posts
    55
    I think I must have done something similar - I was sure I had the same problem with John1980's bundle but, with hindsight, I couldn't have done! That's the problem with having 5 different versions of TWP sitting on the one TiVo I guess! Can never have too much tea...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •