1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

242 Commits

Author SHA1 Message Date
Jeff Trawick
502a0a8eb9 Get mod_cgid killed when a MPM exits due to a fatal error.
Presumably other such processes are affected to.  Now we
give main() a chance to clean up.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92019 13f79535-47bb-0310-9956-ffa450edef68
2001-11-17 14:02:26 +00:00
Ryan Bloom
a4f00625aa Pull lingering close out of the pool cleanup phase. This was causing too
many bugs.  Instead, it is called where it used to be called.  I have
abstracted some of the logic out of the lingering close so that it gets
the socket from the connection using the core's conn_config vector.  This
is in anticipation of a change to use a hook for the lingering close,
which I hope to do soon.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91968 13f79535-47bb-0310-9956-ffa450edef68
2001-11-15 20:49:54 +00:00
Ryan Bloom
7ae4b08b12 Get rid of the listensocks array. It was just duplicating the ap_listeners
list.  No reason to have the same information stored twice.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91960 13f79535-47bb-0310-9956-ffa450edef68
2001-11-15 00:08:26 +00:00
Ryan Bloom
d31fee25f1 Port the worker MPM to the new accept model. This has passed every
test in the test suite (except Limit tests).  We waste a bit of space
with the listensocks array, which is the exact same as the ap_listeners
list, but we have done that for a while.  I'll fix that soon.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91955 13f79535-47bb-0310-9956-ffa450edef68
2001-11-14 23:13:27 +00:00
Ryan Bloom
695081280d Add the server_rec argument back to the create_connection hook.
Submitted by:	Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91913 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 20:29:54 +00:00
Ryan Bloom
aefc6b1525 Remove commas from the end of the macros that define
directives that are used by MPMs.  Previous to this patch,
you would use these macros without commans, which was unlike
any other directives. Now, after the macro, you must have
a comma.  This makes the macros look more like the rest of the
directives.

I know this is cosmetic, and I was going to leave it alone, but when
I found out that it bothered Cliff too, I decided to fix it after all.

Submitted by:	Ryan Bloom and Cliff Woolley


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91896 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 06:04:25 +00:00
Ryan Bloom
26444e2900 Remove more network logic from the MPMs. Essentially, each MPM can define
AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK, which tells Apache to disable_nagle
on the accepted socket.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91889 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 01:24:42 +00:00
Ryan Bloom
0c05b625ac Begin to abstract out the underlying transport layer.
The first step is to remove the socket from the conn_rec,
the server now lives in a context that is passed to the
core's input and output filters. This forces us to be very
careful when adding calls that use the socket directly,
because the socket isn't available in most locations.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91887 13f79535-47bb-0310-9956-ffa450edef68
2001-11-12 23:49:08 +00:00
Jeff Trawick
dd6569995c Really reset the MaxClients value in worker when the
configured value is not a multiple of the number of threads
per child.  We said we did previously but we forgot to.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91880 13f79535-47bb-0310-9956-ffa450edef68
2001-11-12 17:50:59 +00:00
Ryan Bloom
13cf9521f5 Remove ap_lingering_close from all of the MPMs. This is now done as
a cleanup registered with the connection_pool.  I have also turned
ap_lingering_close into a static function, because it is only used
in connection.c.  This is the next step to consolidating all of the
socket function calls.  ap_lingering_close will only be added if the
core is dealing with a standard socket.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91832 13f79535-47bb-0310-9956-ffa450edef68
2001-11-10 18:26:30 +00:00
Cliff Woolley
4421663d68 Fix the spelling of the AP_MPMQ_MIN_SPARE_DAEMONS and
AP_MPMQ_MAX_REQUESTS_DAEMON macros.  Better to do it now rather than later.

**WARNING** This will of course break the compile on any third-party MPMs
you might have floating around, but it's a really quick change to make.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91777 13f79535-47bb-0310-9956-ffa450edef68
2001-11-07 05:29:58 +00:00
Ryan Bloom
dbb19e0e8c Fix the reporting for child processes that die. This removes
all of the non-portable W* macros from Apache.

Submitted by:	Jeff Trawick and Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91648 13f79535-47bb-0310-9956-ffa450edef68
2001-10-23 17:30:07 +00:00
Aaron Bannert
c5ad8779dc Missed some error messages in the switch to the new lock system. Added
the proc_mutex header for the sake of consistency.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91582 13f79535-47bb-0310-9956-ffa450edef68
2001-10-19 23:45:39 +00:00
Aaron Bannert
1eb113209e The worker MPM is now completely ported to APR's new lock API. It
uses native APR types for thread mutexes, cross-process mutexes,
and condition variables. Who's next?


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91580 13f79535-47bb-0310-9956-ffa450edef68
2001-10-19 23:36:55 +00:00
Aaron Bannert
1b8f1827b8 First pass at converting worker MPM to APR's new lock API. This converts
the APR_INTRAPROCESS locks into lightweight, non-nested apr_thread_mutex_t
locks.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91518 13f79535-47bb-0310-9956-ffa450edef68
2001-10-17 00:59:18 +00:00
Ryan Bloom
c9febcdcd5 Fix MaxClients in the Worker MPM, so that it specifies the maximum
number of clients that can connect at the same time, instead of
specifying the maximum number of child processes.
Submitted by:	Aaron Bannert <aaron@clove.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91122 13f79535-47bb-0310-9956-ffa450edef68
2001-09-24 06:42:12 +00:00
Jeff Trawick
11ded91330 if we're gonna trash the connection due to a queue overflow, at the
very least we should close the socket and write a log message (mostly
to aid debugging, as this is a showstopper problem)

this is no fix; there is a design issue to consider; hopefully this
will


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91089 13f79535-47bb-0310-9956-ffa450edef68
2001-09-19 18:47:31 +00:00
Cliff Woolley
93b99eb3d4 I was kinda hoping those (void)some_function() and (request_rec *)NULL
casts would go away before this committed, but alas I didn't say anything.
:-)  This gets rid of them and a few others just like them that I also
found in worker.c.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91082 13f79535-47bb-0310-9956-ffa450edef68
2001-09-19 06:34:11 +00:00
Justin Erenkrantz
1161833224 This patch fixes a nasty bug in the worker MPM where the
state of the worker threads was not being reported back to the
scoreboard, and eventually all the threads running in the children
would be reported as being in the "C -- closing connection" state.
This would wreak havoc on the idle_server_maintenance() routine. Since
these threads would never be counted as idle, the server would
spawn children as fast as possible.

Submitted by:	Aaron Bannert <aaron@clove.org>
Reviewed by:	Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91079 13f79535-47bb-0310-9956-ffa450edef68
2001-09-19 05:58:09 +00:00
Justin Erenkrantz
a8a56e00c5 Switch back to SIGUSR1 for graceful restarts on all platforms that
support it.  This defines a symbol called AP_SIG_GRACEFUL in
ap_config_auto.h which will have the appropriate signal value.  All
direct references to SIGWINCH have been replaced with AP_SIG_GRACEFUL.

On Linux 2.0, use SIGWINCH instead since SIGUSR1 is used by glibc
2.0's user-space threading library to control threads.  All later
versions of Linux/glibc don't have this problem.  (Not to mention the
security holes in older Linux versions which make it unsuitable for
use as a web server.)  If your platform doesn't have SIGUSR1, use the
appropriate mojo in configure to define what your graceful restart
signal should be.

In theory, a configure switch could be added to allow the admin to
specify the appropriate signal that should be used.  This is left
as an exercise to the reader for now.

The docs need to be updated.  Since the signal is now configurable,
just saying SIGUSR1 for graceful restart isn't completely true.  Also,
the apachectl functionality needs to be moved into httpd - this is
what Win32 does and it makes us consistent across platforms.

Roy issued a veto against use of SIGWINCH by default, so this should
resolve that veto.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91076 13f79535-47bb-0310-9956-ffa450edef68
2001-09-18 22:13:59 +00:00
Ryan Bloom
3f8dd5a641 Cleanup the worker MPM. We no longer re-use transaction
pools.  This incurs less overhead than shuffling the pools
around so that they can be re-used.  Remove one of the
queue's condition variables.  We just redefined the API to
state that you can't try to add more stuff than you allocated
segments for.

Submitted by:	  Aaron Bannert <aaron@clove.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91075 13f79535-47bb-0310-9956-ffa450edef68
2001-09-18 21:14:18 +00:00
Justin Erenkrantz
3c90c3f5f4 Add -X functionality back to httpd.
- Updates upgrading.html
- Reverts Aaron's earlier docco patch (sorry...)
- Adds -X to all mpms in the tree


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90824 13f79535-47bb-0310-9956-ffa450edef68
2001-08-30 20:50:06 +00:00
Cliff Woolley
80d015aba9 Update the comments regarding -DONE_PROCESS and -DNO_DETACH since
-X doesn't exist anymore.

Submitted by:	Aaron Bannert


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90790 13f79535-47bb-0310-9956-ffa450edef68
2001-08-30 01:00:50 +00:00
Ryan Bloom
5eb009b6be Remove the declarations for variables that were moved into the core.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90788 13f79535-47bb-0310-9956-ffa450edef68
2001-08-29 23:17:39 +00:00
Ryan Bloom
7c83799b85 Fix a performance problem with the worker MPM. We now create
transaction pools once, and re-use them for each connection.

Submitted by:	Aaron Bannert <aaron@clove.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90771 13f79535-47bb-0310-9956-ffa450edef68
2001-08-28 18:09:36 +00:00
Doug MacEachern
dc90fc000d didt pay attention to the first question; pretty sure answer is no
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90673 13f79535-47bb-0310-9956-ffa450edef68
2001-08-26 01:24:41 +00:00
Doug MacEachern
3ee03083c0 i think the answer to aaron's question is "a typo". otherwise there is
actually 1 less thread available to serve requests than configured.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90670 13f79535-47bb-0310-9956-ffa450edef68
2001-08-26 01:17:32 +00:00
Ryan Bloom
fe4fa0cd35 Make the worker MPM shutdown and restart cleanly. This also
cleans up some race conditions, and gets the worker using
pools more cleanly.

Submitted by:	[Aaron Bannert <aaron@clove.org>]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90635 13f79535-47bb-0310-9956-ffa450edef68
2001-08-24 16:49:39 +00:00
Jeff Trawick
aee4f61414 The Unix MPMs other than perchild now allow child server
processes to use the accept mutex when starting as root and
using SysV sems for the accept mutex.  Previously, this
combination would lead to fatal errors in the child server
processes.  perchild can't use SysV sems because of security
issues.

translation: steal apache 1.3 code to call semop(IPC_SET) on
the semaphore to set permissions and uid/gid


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90213 13f79535-47bb-0310-9956-ffa450edef68
2001-08-16 13:59:14 +00:00
Jeff Trawick
2b5249df23 namespace-protect accept_lock_mech
fix a bug in the worker MPM which effectively disabled the AcceptMutex
directive


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90153 13f79535-47bb-0310-9956-ffa450edef68
2001-08-14 12:30:50 +00:00
Ryan Bloom
8006145310 Begin to sanitize the MPM configuration directives. Now, all
MPMs use the same functions for all common MPM directives.  This
should make it easier to catch all bugs in these directives once.

Everybody should check their favorite MPM to ensure that it still
compiles, and that these directives work.  This is a big patch, and
although it looks good, and things compiled for me, that is no
garauntee that it will work on all platforms.  :-)

Submitted by:	Cody Sherr <csherr@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90132 13f79535-47bb-0310-9956-ffa450edef68
2001-08-13 04:57:35 +00:00
Ryan Bloom
2642621667 The worker MPM now handles shutdown and restart requests. It
definately isn't perfect, but we do stop the servers correctly.
The biggest problem right now is that SIGHUP causes the server to
just die.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90065 13f79535-47bb-0310-9956-ffa450edef68
2001-08-10 05:00:27 +00:00
Greg Ames
5c8e8e3990 record something in the error log if the parent process seg faults
Submitted by: Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90064 13f79535-47bb-0310-9956-ffa450edef68
2001-08-10 01:34:11 +00:00
Ryan Bloom
6adc4b0641 Explain the worker MPM
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89938 13f79535-47bb-0310-9956-ffa450edef68
2001-08-06 15:55:43 +00:00
Ryan Bloom
643dfa0c94 Get the worker MPM working again. This should fix the serialization
problems, and it makes up initialize the queue only once.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89930 13f79535-47bb-0310-9956-ffa450edef68
2001-08-05 18:41:38 +00:00
Greg Ames
ea0bdc760d Speed up the server's response to a spike in incoming workload
or restarts.

New processes aren't able to start all their threads right away
if other dying processes share the same scoreboard real estate.
So give empty process slots in the scoreboard top priority.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89928 13f79535-47bb-0310-9956-ffa450edef68
2001-08-05 18:08:49 +00:00
Jeff Trawick
da63739daa cosmetic changes only for a clean build; no serialization problems
addressed; I presume those are waiting for an APR-ization of the
queue/condition mechanism


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89921 13f79535-47bb-0310-9956-ffa450edef68
2001-08-04 11:40:16 +00:00
Greg Ames
d38326bbb7 fix a problem in the threaded and worker mpm's where a keepalive connection
on one thread can prevent the process from exiting.

let's rename ap_graceful_restart_signalled to something more appropriate
after the next beta.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89881 13f79535-47bb-0310-9956-ffa450edef68
2001-08-02 21:24:14 +00:00
Ryan Bloom
5bfcf2aa8e It helps if we broadcast to the workers that we are trying to shutdown.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89827 13f79535-47bb-0310-9956-ffa450edef68
2001-07-31 15:35:28 +00:00
Greg Ames
f61f91fc70 don't count workers in processes which aren't actively serving requests.
it is necessary to check for the generation as well as "quiescing", in the
case of a restart where no workers have seen the PoD yet.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89821 13f79535-47bb-0310-9956-ffa450edef68
2001-07-31 06:22:32 +00:00
Greg Ames
f699845c86 threads in process which are quiescing (due to PoD or MaxRequestsPerChild)
should not be counted as idle threads.  This can cause the server to stall.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89817 13f79535-47bb-0310-9956-ffa450edef68
2001-07-31 03:08:42 +00:00
Ryan Bloom
f6371b63d9 Add the worker MPM. The name is probably horrible, but I couldn't come
up with anything better.  This is a multiple-worker/single listener MPM.
This MPM is definately not complete, but it is a first step in the
right direction.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89781 13f79535-47bb-0310-9956-ffa450edef68
2001-07-30 05:02:53 +00:00