problem with error_log_spread.pl

"Jay West" <[email protected]> Fri, 15 Nov 2002 11:20:25 -0600
Newsgroups gmane.comp.apache.mod-log-spread.user
Message-ID <[email protected]>
Some time ago I raised this issue, but it hasn't been resolved yet:

I have a number of websites which are configured with the following line....

CustomLog "|/usr/local/sbin/error_log_spread.pl -g test"

When you do an "apachectl start" to start the webserver, apache starts a
separate process for each of the error_log_spread.pl invocations. If they
all go fine, each error_log_spread.pl line generates a linefeed. So if I
have 10 sites using the above line (but with a different spreadlog group for
each), an "apachectl start" generates 10 line feeds then returns to a
command prompt and everything is perfect.

However, about 50% of the time, when I do "apachectl start", I will get some
number of messages from error_log_spread.pl that say "Could not connect",
and the balance of linefeeds. For example, one time I do the apachectl start
I may get 3 "could not connect" messages and 7 linefeeds (total 10 results).
It is not always the same customlog statements generating the could not
connect message. If I stop and start apache, I may get 2 could not connects
and 8 linefeeds. If I do it several times, finally I will just get the 10
linefeeds. The long and short of it is... out of 10 custom log directives
calling error_log_spread.pl, SOME number of them fail to connect UPON
STARTUP ONLY.

What this tells me is that there is some sporadic timing condition where the
error_log_spread.pl script can't make the initial connection to spread. The
net effect of this is some of the websites don't get logging when this
happens. This is especially problematic for us, as the websites are updated
remotely by the programmers, and the script does this...

apachectl stop
wackatrl -f
(cvs/rsync stuff)
wackatrl -s
apachectl start

So, when they trigger the script, about 50% of the time, not all the loggers
start, a very bad thing.

I would suggest the way to do this is modify the error_log_spread.pl script
so that if it fails to connect, it tries like 3 times before giving up or
something along those lines. However, I'm not a perl programmer so I have no
idea how to do this. George sent me a modification but it didn't run :( Any
thoughts?

Thanks!!!

Jay West

---
[This E-mail scanned for viruses by Declude Virus]