You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by David Reid <dr...@jetnet.co.uk> on 2002/01/08 11:24:32 UTC
plog for log files?
Having spent a long time looking at the FreeBSD problem, it finally came
down to stderr being closed and the fd number being resused and causing the
kernel to loop.
It looks like the problem was that we close the sockets when we clean up the
pconf pool, which is bad. Using the plog pool doesn't result in the same
problem as we open the log files just after the pool clear, thus keeping
stderr pointing at something.
Is there any reason why we can't use plog in core.c, as in this patch?
david
Index: core.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/core.c,v
retrieving revision 1.126
diff -u -r1.126 core.c
--- core.c 2 Jan 2002 07:56:25 -0000 1.126
+++ core.c 8 Jan 2002 10:21:48 -0000
@@ -3361,7 +3361,7 @@
static int core_open_logs(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t
*ptemp, server_rec *s)
{
- ap_open_logs(s, pconf);
+ ap_open_logs(s, plog);
return OK;
}
Re: API for runtime httpd config ?
Posted by Ian Holsman <ia...@apache.org>.
ilker ARABACI wrote:
> Is there any API used or on progress to get httpd global and configuration
> values on runtime,
> (not an httpd.conf file parser), something and more detailed like info
> module does,
> And also it would be more helpful to manuplate what will httpd act as
> without restarting nor reloading,
> to keep the active (unrelated to changes) sessions and connections up.
>
> ilker ARABACI
> *NxServers / TR
>
>
>
in 2.0 you can do a gracefull restart which will keep the existing
requests up. The keepalives might die, but thats ok.
Re: API for runtime httpd config ?
Posted by Eli Marmor <ma...@netmask.it>.
ilker ARABACI wrote:
> Is there any API used or on progress to get httpd global and configuration
> values on runtime,
> (not an httpd.conf file parser), something and more detailed like info
> module does,
> And also it would be more helpful to manuplate what will httpd act as
> without restarting nor reloading,
> to keep the active (unrelated to changes) sessions and connections up.
Your questions raised a serious drawback of Apache: on-the-fly
administration/configuration. In my humble opinion, it's even the main
drawback of Apache (and the only thing that stands between Apache and
perfection).
Historically, any module parses its directives. There are some public
functions, but they are too basic, and each module decides what is
valid and what is not, how to translate each string, and even where to
store it. Some directives even use a "raw" parsing - i.e. no rules
regarding how many flags the directive should have. Modules may even
ignore directives.
Asking Apache to re-read its configuration is problematic too; Even the
primitive way, of "killing" it, is impossible, because a non-root user
can't kill a root user, even if it is its parent. Also, there is no
mechanism for transferring messages from the children to the parent
initiated by the children, but only vice versa (e.g. scoreboard). There
are some "creative" alternatives, like exiting with codes that the
parent will "understand" as requests to do specific things (like stop/
restart/graceful), but this method is too tricky, doesn't work in 100%
of the cases and the platforms, limited (you can't pass more details),
and has a lot of other problems.
These problems makes the mission of developing a GUI for Apache almost
impossible, and the results - although should be admired considering
the tight constraints - are very disappointing.
Some solutions for both problems were discussed in the past. A *MAJOR*
change in the format of httpd.conf and its handling could help. For
example, migrating to XML, and replacing the conf structures by
structures with offsets to the member in another structure where the
module stores its attributes, plus functions for validation/conversion
/reverse-conversion for each "type", could resolve almost everything.
It helped X (although the syntax was a little different - not XML),
and there is no reason why Apache should differ. Of course, adding a
pre-processor which will convert XML syntax to the current syntax,
doesn't solve anything...
"Unfortunately", Apache is the most popular web server, and millions
sites are already powered by it. It means that millions configuration
files will not be compatible with the new syntax. In addition, there
are hundreds of modules, and all of them will not be compatible with
the new syntax and C structures, unless ported to them.
This is why the "revolution" will never happen, so your questions will
remain unanswerred forever.
Note: We are trying to add functions to meet your second need -
apr_stop(), apr_restart(), apr_graceful(). When one of these functions
is called by the parent, it will stop/restart/graceful itself. When it
is called by a child, it will inform the parent in a special "pipe"
that will be listened by the parent. Once the parent receives anything
in this pipe, it will decode it, and call anything needed.
If it works perfectly with all the MPMs, we will probably contribute
it.
--
Eli Marmor
marmor@netmask.it
CTO, Founder
Netmask (El-Mar) Internet Technologies Ltd.
__________________________________________________________
Tel.: +972-9-766-1020 8 Yad-Harutzim St.
Fax.: +972-9-766-1314 P.O.B. 7004
Mobile: +972-50-23-7338 Kfar-Saba 44641, Israel
API for runtime httpd config ?
Posted by ilker ARABACI <i....@hiperaktif.com>.
Is there any API used or on progress to get httpd global and configuration
values on runtime,
(not an httpd.conf file parser), something and more detailed like info
module does,
And also it would be more helpful to manuplate what will httpd act as
without restarting nor reloading,
to keep the active (unrelated to changes) sessions and connections up.
ilker ARABACI
*NxServers / TR
Re: plog for log files?
Posted by David Reid <dr...@jetnet.co.uk>.
Huh, we just move the pool for logfiles... Not sure if that qualifies as a
workaround.
Commit on the way.
david
----- Original Message -----
From: "Jeff Trawick" <tr...@attglobal.net>
To: <de...@httpd.apache.org>
Sent: Tuesday, January 08, 2002 3:57 PM
Subject: Re: plog for log files?
> "David Reid" <dr...@jetnet.co.uk> writes:
>
> > Jeff,
> >
> > I think the problem lies in the way that we deal with stderr. basically
> > with threaded freeBSD we have the kernel signal pipe looking at stderr
and
> > thus always returning 1, even though there is no signal there to process
> > (this has been checked by both justie and myself).
>
> FreeBSD bug...
>
> > Anyway, if this won't hurt anything then is there any objection to doing
it?
> > If there isn't, and given it will cure one bug, I'll commit.
>
> I don't want to see us putting in a lot of work-arounds for FreeBSD
> snafus.
>
> If as far as we know just about everything else in threaded Apache
> works fine on FreeBSD with this patch, then go for it.
>
> If this is just one of various outstanding issues, adding the
> work-around to CVS removes a testcase for anybody wanting to get
> FreeBSD threading up-to-snuff and it doesn't make Apache work
> reliably anyway.
>
> --
> Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
> http://www.geocities.com/SiliconValley/Park/9289/
> Born in Roswell... married an alien...
>
Re: plog for log files?
Posted by Jeff Trawick <tr...@attglobal.net>.
"David Reid" <dr...@jetnet.co.uk> writes:
> Jeff,
>
> I think the problem lies in the way that we deal with stderr. basically
> with threaded freeBSD we have the kernel signal pipe looking at stderr and
> thus always returning 1, even though there is no signal there to process
> (this has been checked by both justie and myself).
FreeBSD bug...
> Anyway, if this won't hurt anything then is there any objection to doing it?
> If there isn't, and given it will cure one bug, I'll commit.
I don't want to see us putting in a lot of work-arounds for FreeBSD
snafus.
If as far as we know just about everything else in threaded Apache
works fine on FreeBSD with this patch, then go for it.
If this is just one of various outstanding issues, adding the
work-around to CVS removes a testcase for anybody wanting to get
FreeBSD threading up-to-snuff and it doesn't make Apache work
reliably anyway.
--
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...
Re: plog for log files?
Posted by David Reid <dr...@jetnet.co.uk>.
Jeff,
I think the problem lies in the way that we deal with stderr. basically
with threaded freeBSD we have the kernel signal pipe looking at stderr and
thus always returning 1, even though there is no signal there to process
(this has been checked by both justie and myself).
The issue that this solves is that when you start the server the cpou time
stays where it should, not climbing rapidly towards 99%! There is at least
one remaining issue, but to be honest this feels like the correct fix. In
fact I'd go slightly further and suggest that we move the call to
apr_clear_pool(plog) from main.c into ap_open_logs as we call the clear each
time we actually open the logs and having it as the first thing done when
opening the logs makes more sense to me.
Anyway, if this won't hurt anything then is there any objection to doing it?
If there isn't, and given it will cure one bug, I'll commit.
david
----- Original Message -----
From: "Jeff Trawick" <tr...@attglobal.net>
To: <de...@httpd.apache.org>
Sent: Tuesday, January 08, 2002 12:25 PM
Subject: Re: plog for log files?
> "David Reid" <dr...@jetnet.co.uk> writes:
>
> > Having spent a long time looking at the FreeBSD problem, it finally came
> > down to stderr being closed and the fd number being resused and causing
the
> > kernel to loop.
> >
> > It looks like the problem was that we close the sockets when we clean up
the
> > pconf pool, which is bad. Using the plog pool doesn't result in the
same
> > problem as we open the log files just after the pool clear, thus keeping
> > stderr pointing at something.
>
> I saw something related to this a long time ago but didn't nail
> it down so succinctly. One day my regression tests started bombing on
> FreeBSD 3.4. I couldn't repeat the problem manually until I
> duplicated the redirection of stdout and stderr as done by the testing.
> I added --disable-threads to my configure invocation and it worked.
>
> For your comments above, can you clarify which bad behavior is due to
> FreeBSD bugs and which bad behavior is due to Apache doing stuff it
> shouldn't be doing?
>
> Is some level of FreeBSD so close to working with threaded Apache that
> it makes sense to put in work-arounds?
>
> --
> Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
> http://www.geocities.com/SiliconValley/Park/9289/
> Born in Roswell... married an alien...
>
Re: plog for log files?
Posted by Jeff Trawick <tr...@attglobal.net>.
"David Reid" <dr...@jetnet.co.uk> writes:
> Having spent a long time looking at the FreeBSD problem, it finally came
> down to stderr being closed and the fd number being resused and causing the
> kernel to loop.
>
> It looks like the problem was that we close the sockets when we clean up the
> pconf pool, which is bad. Using the plog pool doesn't result in the same
> problem as we open the log files just after the pool clear, thus keeping
> stderr pointing at something.
I saw something related to this a long time ago but didn't nail
it down so succinctly. One day my regression tests started bombing on
FreeBSD 3.4. I couldn't repeat the problem manually until I
duplicated the redirection of stdout and stderr as done by the testing.
I added --disable-threads to my configure invocation and it worked.
For your comments above, can you clarify which bad behavior is due to
FreeBSD bugs and which bad behavior is due to Apache doing stuff it
shouldn't be doing?
Is some level of FreeBSD so close to working with threaded Apache that
it makes sense to put in work-arounds?
--
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...