Bug#349745: squid-prefetch: Crashes every few minutes
Matej Vela wrote: Nigel Horne [EMAIL PROTECTED] writes: I will report on whether squid-prefetch now stays up. Any luck? (Please Cc: the bug on replies.) I now stays up thanks, though I can't work out how to be sure it's doing anything since it doesn't have a log file. -Nigel Horne begin:vcard fn:Nigel Horne n:Horne;Nigel org:NJH Music email;internet:[EMAIL PROTECTED] tel;fax:+44 870 705 9334 note:Skype: nigelhorne x-mozilla-html:FALSE version:2.1 end:vcard
Bug#349745: squid-prefetch: Crashes every few minutes
I now stays up thanks, though I can't work out how to be sure it's doing anything since it doesn't have a log file. Check out Squid's log file. Accesses from 127.0.0.1 will be from the prefetch. Brian ( [EMAIL PROTECTED] ) --- Idleness, indifference irresponsibility are healthy responses to absurd work. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#349745: squid-prefetch: Crashes every few minutes
On Sat, 2006-03-18 at 14:39 -0500, Brian White wrote: I now stays up thanks, though I can't work out how to be sure it's doing anything since it doesn't have a log file. Check out Squid's log file. Accesses from 127.0.0.1 will be from the prefetch. Not necessarily. 127.0.0.1 is the network loopback device, so *any* program on that machine which accesses the outside world via squid will show as 127.0.0.1 in the squid log, not just squid-prefetch as you imply. Brian ( [EMAIL PROTECTED] ) -- Nigel Horne. Arranger, Adjudicator, Band Trainer, Composer, Tutor, Typesetter. NJH Music, Barnsley, UK. ICQ#20252325 [EMAIL PROTECTED] http://www.bandsman.co.uk -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#349745: squid-prefetch: Crashes every few minutes
Not necessarily. 127.0.0.1 is the network loopback device, so *any* program on that machine which accesses the outside world via squid will show as 127.0.0.1 in the squid log, not just squid-prefetch as you imply. True. I don't use the loopback interface for connecting to squid from user clients, so I don't have that ambiguity. You can usually differentiate between clients and squid-prefetch by the log line itself. The first access by squid-prefetch will always be a TCP_HIT/200 or TCP_MISS/504 (I think it's 504). After that will be the prefetches. Or... just run it from the command line so you can see STDOUT. Brian ( [EMAIL PROTECTED] ) --- There's no healthy way to mess with the line between wrong and right. oel) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#349745: squid-prefetch: Crashes every few minutes
Nigel Horne [EMAIL PROTECTED] writes: I will report on whether squid-prefetch now stays up. Any luck? (Please Cc: the bug on replies.) Thanks, Matej -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#349745: squid-prefetch: Crashes every few minutes
I will report on whether squid-prefetch now stays up. Any luck? (Please Cc: the bug on replies.) It is running now, without dying. I haven't replied because it's now being hammered by my search engine's spider - and I want to wait and see if it stays up during that. Thanks, Matej -Nigel Horne -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#349745: squid-prefetch: Crashes every few minutes
tag 349745 patch moreinfo thanks Nigel Horne [EMAIL PROTECTED] writes: [...] njh:/var/log/squid# /usr/sbin/squid-prefetch Alarm clock It seems the alarm timer isn't getting reset in case of exceptions. Does the attached patch work for you? Thanks! Matej --- squid-prefetch~ +++ squid-prefetch @@ -144,14 +144,18 @@ local $SIG{ALRM} = sub { die Error: Timeout fetching $url\n }; alarm(3); + eval { my $http = Net::HTTP-new(PeerHost = $ProxyHost, PeerPort = $ProxyPort, Host = $host, SendTE = 0, KeepAlive = 0); $http-write_request(GET = http://$host$path;, Accept = text/html, Cache-Control = only-if-cached, User-Agent = Squid-Prefetch); my ($code,$mesg,%hdrs) = $http-read_response_headers(); print \nfetch: $url: $code ($mesg)\n; print $k - $v\n while (($k,$v) = each %hdrs); + }; alarm(0); + die if $@; + if ($code != 200) { print STDERR Warning: fetch returned code $code ($mesg) for $url\n; return; @@ -170,6 +174,7 @@ } alarm(5); + eval { while (1) { my $bufr; my $size = $http-read_entity_body($bufr,4096); @@ -193,7 +198,9 @@ $data =~ s!^.*($|)!!; } + }; alarm(0); + die if $@; @links = uniq(sort(@links)); RandomizeArray([EMAIL PROTECTED]); @@ -216,14 +223,18 @@ local $SIG{ALRM} = sub { die Error: Timeout fetching $url\n }; alarm(3); + eval { my $http = Net::HTTP-new(PeerHost = $ProxyHost, PeerPort = $ProxyPort, Host = $host, SendTE = 1, KeepAlive = 0); $http-write_request(GET = http://$host$path;, Accept = text/*, User-Agent = Squid-Prefetch); my ($code,$mesg,%hdrs) = $http-read_response_headers(); print \nprefetch: $url: $code ($mesg)\n; # print $k - $v\n while (($k,$v) = each %hdrs); + }; alarm(0); + die if $@; + if ($code != 200) { print STDERR Warning: fetch returned code $code ($mesg) for $url\n; return; @@ -238,6 +249,7 @@ } alarm(5); + eval { while (1) { my $bufr; my $size = $http-read_entity_body($bufr,4096); @@ -246,7 +258,9 @@ $total += $size; last if ($total $FetchMaxSize); } + }; alarm(0); + die if $@; }
Bug#349745: squid-prefetch: Crashes every few minutes
Package: squid-prefetch Version: 1.0-1 Severity: grave Justification: renders package unusable I found that the program will only run for a few minutes before it stops. I ran it from the command line to keep an eye on it and found it crashes thus: njh:/var/log/squid# /usr/sbin/squid-prefetch Alarm clock njh:/var/log/squid# -- System Information: Debian Release: testing/unstable APT prefers testing APT policy: (500, 'testing') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.4.27-1-386 Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1) Versions of packages squid-prefetch depends on: ii liburi-perl 1.35-1 Manipulates and accesses URI strin ii libwww-perl 5.803-4WWW client/server library for Perl ii squid 2.5.12-3 Internet Object Cache (WWW proxy c squid-prefetch recommends no packages. -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]