On Thu, Oct 10, 2002 at 11:07:49PM -0700, Crist J. Clark wrote:
> Has anyone found the bug? Razor checks are _supposed_ to
> timeout. While all of this was happening, if you ran spamassassin, it
> would properly timeout. If you fired up spamd, it would properly
> timeout the Razor check during the initialization (watch the debug
> output), but the children it spawned would all hang _forever_ in the
> Razor check rather than timeout. That makes me suspicios that
> something was not being reinitialized in the timeout check or some
> other issue due to spamd being a bit of a kludge in the first place.

I've been thinking about this for a little bit this morning...  The way
we timeout the Razor check (and DCC, and Pyzor, etc) is through the
use of alarm().  I can't verify it, but looking at the code, Razor2
calls Net::Ping to do a TCP ping check (try poking at port "echo"),
which also has a timeout using alarm() (not to mention the fact that it
resets $SIG{ALRM} without a local -- stupid Net::Ping!).  Since there can
only be a single alarm, I think the order of events is this:

- SA says timeout in X seconds, and call out function Xfunc when it happens.
- SA starts the Razor code
- Razor code calls Net::Ping
- Net::Ping says timeout in Y seconds and call "die" when it happens
- Net::Ping does ping
- if successful, cancel alarm (alarm(0)), otherwise die.
- return to Razor code, with no alarm set.

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...

-- 
Randomly Generated Tagline:
"I have been a happy man ever since January 1, 1990, when I no longer
 had an email address. I'd used email since about 1975, and it seems to
 me that 15 years of email is plenty for one lifetime."  - Donald Knuth

Attachment: msg08759/pgp00000.pgp
Description: PGP signature

Reply via email to