On Fri, Oct 11, 2002 at 12:14:40PM -0400, Theo Van Dinter wrote: > So if I'm right, the razor_timeout stuff is useless in SA since Net::Ping > just cancels the alarm on us, and we'd end up seeing hangs on Razor > calls since it never times out. > > I wonder if there's a way to find out the setting for alarm via debugger...
Ok, I finally got some time on the train tonight(*) to look at this. I didn't get to find out the value for alarm, but I did verify that SA calls get_server_info() (I knew that already), which then calls nextserver() which calls discover(), which ends up calling Net::Ping. I've put in a patch against HEAD (2.50-cvs) that I think will take care of the problem. Basically it duplicates the "alarm $timeout" call right after the get_server_info() call in Dns.pm and Reporter.pm. I've attached the patch if you want to give it a shot. If things look good, I'll put it into the standard 2.4x branch of code. :) -- Randomly Generated Tagline: Foul temptress. I'll bet she thinks Ziggy's gotten too preachy, too! -- Homer Simpson The Last Temptation of Homer
Index: Dns.pm =================================================================== RCS file: /cvsroot/spamassassin/spamassassin/lib/Mail/SpamAssassin/Dns.pm,v retrieving revision 1.67 retrieving revision 1.68 diff -b -w -u -d -r1.67 -r1.68 --- Dns.pm 26 Sep 2002 17:15:00 -0000 1.67 +++ Dns.pm 16 Oct 2002 00:21:49 -0000 1.68 @@ -390,6 +390,12 @@ my $objects = $rc->prepare_objects( \@msg ) or die "error in prepare_objects"; $rc->get_server_info() or die $rc->errprefix("checkit"); + + # let's reset the alarm since get_server_info() calls + # nextserver() which calls discover() which very likely will + # reset the alarm for us ... how polite. :( + alarm $timeout; + my $sigs = $rc->compute_sigs($objects) or die "error in compute_sigs"; Index: Reporter.pm =================================================================== RCS file: /cvsroot/spamassassin/spamassassin/lib/Mail/SpamAssassin/Reporter.pm,v retrieving revision 1.39 retrieving revision 1.40 diff -b -w -u -d -r1.39 -r1.40 --- Reporter.pm 8 Oct 2002 11:40:22 -0000 1.39 +++ Reporter.pm 16 Oct 2002 00:21:50 -0000 1.40 @@ -156,6 +156,12 @@ my $objects = $rc->prepare_objects( \@msg ) or adie ("error in prepare_objects"); $rc->get_server_info() or adie $rc->errprefix("reportit"); + + # let's reset the alarm since get_server_info() calls + # nextserver() which calls discover() which very likely will + # reset the alarm for us ... how polite. :( + alarm $timeout; + my $sigs = $rc->compute_sigs($objects) or adie ("error in compute_sigs");
msg08899/pgp00000.pgp
Description: PGP signature