Log of /httpd/httpd/branches/2.2.x/server/mpm/worker/worker.c
Parent Directory
Revision
556936 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Tue Jul 17 14:48:25 2007 UTC (13 months, 2 weeks ago) by
jorton
File length: 81596 byte(s)
Diff to
previous 446606
(
colored)
Merge r551843, r551889 from trunk:
Add alternative fixes for CVE-2007-3304:
* configure.in: Check for getpgid.
* include/mpm_common.h (ap_mpm_safe_kill): New prototype.
* server/mpm_common.c (reclaim_one_pid): Ensure pid validity before
calling apr_proc_wait().
(ap_mpm_safe_kill): New function.
* server/mpm/prefork/prefork.c, server/mpm/worker/worker.c,
server/mpm/experimental/event/event.c: Use ap_mpm_safe_kill() on pids
from the scoreboard, throughout.
* include/ap_mmn.h: Minor bump.
* server/mpm_common.c: getpgid() returns a pid_t
Submitted by: jorton, jim
Reviewed by: jorton, jim, rpluem
Revision
446606 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Fri Sep 15 13:19:25 2006 UTC (23 months, 3 weeks ago) by
trawick
File length: 81673 byte(s)
Diff to
previous 424876
(
colored)
merge from trunk (but preserve ap_get_server_version()):
*) The full server version information is now included in the error log at
startup as well as server status reports, irrespective of the setting
of the ServerTokens directive. ap_get_server_version() is now
deprecated, and is replaced by ap_get_server_banner() and
ap_get_server_description().
Reviewed by: rpluem, jim
Revision
424876 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 24 01:43:24 2006 UTC (2 years, 1 month ago) by
trawick
File length: 81669 byte(s)
Diff to
previous 424874
(
colored)
merge from trunk:
Worker MPM: On graceless shutdown or restart, send signals to
each worker thread to wake them up if they're polling on a
Keep-Alive connection. PR 38737. [Chris Darroch]
PR: 38737
Reviewed by: chrisd, trawick, niq
Revision
424874 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 24 01:34:58 2006 UTC (2 years, 1 month ago) by
trawick
File length: 80659 byte(s)
Diff to
previous 421103
(
colored)
merge from trunk:
worker and event MPMs: fix excessive forking if fork() or child_init
take a long time.
PR: 39275
Reviewed by: trawick, gregames, pquerna
Revision
410935 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Thu Jun 1 20:12:51 2006 UTC (2 years, 3 months ago) by
rpluem
File length: 80536 byte(s)
Diff to
previous 396056
(
colored)
Merge r377291 from trunk:
Make the worker and event MPMs support GracefulShutdownTimeout just like
the prefork MPM does.
Submitted by: Chris Darroch <chrisd pearsoncmg.com>
Ported to event MPM by: rooneg
Issue number: 38621
* server/mpm/worker/worker.c
(ap_mpm_run): Make the graceful shutdown log message refer to the right
signal, and respect the graceful shutdown timeout if there is one.
* server/mpm/experimental/event/event.c
(ap_mpm_run): Ditto.
* CHANGES: Note change.
Submitted by: chrisd, rooneg
Reviewed by: chrisd, rpluem, trawick
PR: 38621
Revision
332309 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Thu Nov 10 15:20:05 2005 UTC (2 years, 9 months ago) by
jim
File length: 80313 byte(s)
Diff to
previous 332307
(
colored)
No functional change: remove trailing whitespace. This also means
that "blank" lines, which had consisted of just spaces
and/or tabs are now truly blank lines
Revision
293164 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Sun Oct 2 20:56:56 2005 UTC (2 years, 11 months ago) by
colm
File length: 80658 byte(s)
Diff to
previous 292949
(
colored)
Merge r265518-9 from trunk; explicit assignment of some global variables
to zero. These should not be neccessary, but help us get around a gcc
(on ia64 at least) optimisation bug. They are harmless anyway.
Revision
292949 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Sat Oct 1 11:02:10 2005 UTC (2 years, 11 months ago) by
trawick
File length: 80650 byte(s)
Diff to
previous 290189
(
colored)
merge from trunk:
*) SECURITY: CAN-2005-2970 (cve.mitre.org)
worker MPM: Fix a memory leak which can occur after an aborted
connection in some limited circumstances. [Greg Ames, Jeff Trawick]
Revision
290179 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Mon Sep 19 14:57:07 2005 UTC (2 years, 11 months ago) by
colm
File length: 77968 byte(s)
Diff to
previous 234103
(
colored)
Backport r239710, r239711, r239732, r239740 and r241815 to the 2.2.x branch;
Fix PR 28167, which means we stop listening on ports when we do a
graceful-restart.
Revision
156274 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Sat Mar 5 20:06:55 2005 UTC (3 years, 6 months ago) by
trawick
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 77144 byte(s)
Diff to
previous 151408
(
colored)
worker MPM/mod_status: Support per-worker tracking of pid and
generation in the scoreboard so that mod_status can accurately
represent workers in processes which are gracefully terminating.
New child processes with worker MPM can take over slots of
individual threads within gracefully terminating processes.
Sometimes this is a problem (too many of these gracefully
terminating processes), so it is helpful to have mod_status
provide the information required to recognize these processes.
Revision
109510 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Thu Dec 2 17:39:22 2004 UTC (3 years, 9 months ago) by
trawick
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76940 byte(s)
Diff to
previous 106103
(
colored)
worker MPM: Fix a problem which could cause httpd processes to
remain active after shutdown.
The problem occurred when a scoreboard entry currently
in use by an exiting child process was used for a new child
process. At that point, the MPM forgot about the exiting
child process, so ap_reclaim_child_processes() wouldn't be
able to forceably terminate it.
(An exiting child process may *never* exit due to a stuck
or long-running request being handled on one of the threads.)
Revision
102931 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Thu Mar 11 03:57:50 2004 UTC (4 years, 5 months ago) by
trawick
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76010 byte(s)
Diff to
previous 102619
(
colored)
Threaded MPMs for Unix and Win32: Add WorkerStackSize directive
to override default thread stack size for threads which handle
client connections. Required for some third-party modules on
platforms with small default thread stack size.
This is also useful for trimming back the stack size on
platforms with relatively large default stack size in order to
conserve address space for supporting more threads per child.
Revision
101801 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Sun Nov 16 23:47:07 2003 UTC (4 years, 9 months ago) by
gstein
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 77495 byte(s)
Diff to
previous 101165
(
colored)
Switch over to the new pollset API.
* server/mpm/worker/worker.c:
(listener_thread): create and add sockets to the pollset using the new
APIs. rearrange the round-robin a little bit to work with the new
pollset return values.
cleaning: get rid of an extraneous status variable. get rid of
obsoleted round-robin code.
Revision
101122 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Thu Aug 28 05:54:44 2003 UTC (5 years ago) by
jwoolley
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76534 byte(s)
Diff to
previous 101117
(
colored)
Updated the various MPM's to use the new bucket_alloc_create_ex API
when necessary. Which is to say that it's necessary in all cases except
for prefork, where the change to apr-util to have it use the allocator
from the pool passed in is already sufficient.
Reviewed by: Jean-Jacques Clar, Sander Striker, Brad Nicholes
Revision
99312 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Wed Apr 9 16:58:30 2003 UTC (5 years, 4 months ago) by
trawick
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76498 byte(s)
Diff to
previous 98573
(
colored)
consolidate code related to sig_coredump
a note on perchild:
perchild exception handling was busted before this and is still busted
the problem I noticed was that a client that exposes a segfault never
gets its connection dropped and the parent never notices that the
child process that segfaulted hasexited
Revision
95954 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Thu Jul 4 15:20:54 2002 UTC (6 years, 2 months ago) by
striker
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78929 byte(s)
Diff to
previous 95568
(
colored)
Add a new directive: MaxMemFree. MaxMemFree makes it possible
to configure the maximum amount of memory the allocators will
hold on to for reuse. Anything over the MaxMemFree threshold
will be free()d. This directive is usefull when uncommon large
peaks occur in memory usage. It should _not_ be used to mask
defective modules' memory use.
Revision
95237 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Thu May 23 12:58:37 2002 UTC (6 years, 3 months ago) by
trawick
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78419 byte(s)
Diff to
previous 95149
(
colored)
Add "-k start|startssl|restart|graceful|stop" support to httpd
for the Unix MPMs. These have semantics very similar to the
old apachectl commands of the same name.
The use of stderr/stdout and exit status for error conditions
needs to be revisited. For now it matches apachectl behavior.
Justin Erenkrantz got the ball rolling with this feature. Some
of his support code was used unchanged. Other code was shuffled
around and modified or rewritten.
Revision
94889 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Wed May 1 15:06:44 2002 UTC (6 years, 4 months ago) by
stoddard
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 79090 byte(s)
Diff to
previous 94886
(
colored)
Defer starting the listener until we have at least tried to start all the worker
threads. We want to get the workers in the pool of available threads ASAP
to keep perform_idle_server_maintenance from thrashing and starting too
many processes prematurely. The code before this patch would dribble workers
into the worker pool over an extended period of time and this prevented
perform_idle_server_maintenance from accurately deciding when new processes
were needed.
Revision
94830 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Sun Apr 28 05:28:18 2002 UTC (6 years, 4 months ago) by
brianp
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78224 byte(s)
Diff to
previous 94824
(
colored)
Moved the recycled pool list from the queue to the queue_info structure.
The advantage of doing this is that it enables us to guarantee that the
number of ptrans pools in existence at once is no greater than the
number of worker threads, and that we'll never have to delete ptrans
pools.
Revision
94824 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Sun Apr 28 01:45:00 2002 UTC (6 years, 4 months ago) by
aaron
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78165 byte(s)
Diff to
previous 94700
(
colored)
Add a "queue_info" structure to the worker MPM. This is used to prevent
the listener thread from accept()ing more connections than there are
available workers. This prevents long-running requests from starving
connections that have been accepted but not yet processed.
The queue_info is a simple counter, mutex, and condition variable. Only
the listener thread blocks on the condition, and only when there are no
idle workers. In the fast path there is a mutex lock, integer decrement,
and and unlock (among a few conditionals). The worker threads each notify
the queue_info when they are about to block on the normal worker_queue
waiting for some connection to process, which wakes up any sleeping
listener thread to go perform another accept() in parallel.
Revision
94420 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Wed Apr 3 15:47:59 2002 UTC (6 years, 5 months ago) by
trawick
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76773 byte(s)
Diff to
previous 94417
(
colored)
worker MPM:
Don't create a listener thread until we have a worker thread. Otherwise,
in situations where we'll have to wait a while to take over scoreboard
slots from a previous generation, we'll be accepting connections we can't
process yet.
Don't let the listener thread clobber the scoreboard entry of the first
worker thread.
Revision
94306 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Fri Mar 29 14:33:50 2002 UTC (6 years, 5 months ago) by
jim
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76366 byte(s)
Diff to
previous 94304
(
colored)
The old, legacy (and unused) code in which the scoreboard was totally
and completely contained in a file (SCOREBOARD_FILE) has been
removed. This does not affect scoreboards which are *mapped* to
files using named-shared-memory at all. This implies that scoreboards
must be based, at some level, on native shared memory (mmap, shm_open,
shmget, whatever), but the code has assumed that for quite awhile
now. Having the scoreboard be *based* on a file makes no sense today.
PR:
Obtained from:
Submitted by:
Reviewed by:
Revision
94304 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Fri Mar 29 08:17:26 2002 UTC (6 years, 5 months ago) by
jwoolley
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76466 byte(s)
Diff to
previous 94232
(
colored)
BUCKET FREELISTS
Add an allocator-passing mechanism throughout the bucket brigades API.
From Apache's standpoint, the apr_bucket_alloc_t* used throughout a given
connection is stored in the conn_rec by the create_connection hook. That
means it's the MPM's job to optimize recycling of apr_bucket_alloc_t's --
the MPM must ensure that no two threads can ever use the same one at the
same time, for instance.
Revision
94232 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Wed Mar 27 20:37:32 2002 UTC (6 years, 5 months ago) by
trawick
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76205 byte(s)
Diff to
previous 94117
(
colored)
worker MPM:
get MaxRequestsPerChild to work again by allowing the main thread of
a child to be interrupted by one of the other threads in the process
this should get graceful termination to work after encountering one of
the various possible error conditions in the listener and worker threads
Revision
94106 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Thu Mar 21 19:12:54 2002 UTC (6 years, 5 months ago) by
trawick
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 75424 byte(s)
Diff to
previous 94095
(
colored)
Don't drop connections during graceful restart. Previously, worker
threads could exit even though there were connections waiting in the
queue.
Now, for a graceful restart the worker threads won't exit until they
are told that the queue has been drained and no more connections will
ever be added.
Revision
94095 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Thu Mar 21 16:31:39 2002 UTC (6 years, 5 months ago) by
trawick
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 74794 byte(s)
Diff to
previous 94094
(
colored)
graceful shutdown (no dropped connections) requires that the listener
go away before the workers... introduce separate XXX_may_exit flags
for our different categories of threads so that a future fix for
graceful shutdown can terminate them in the right order
rename signal_workers() to signal_threads() and give it a parameter
so it knows whether or not termination should be graceful
this commit doesn't change the behavior in any noticeable way; the
flags used to tell threads to go away are still set at about the same
time
Revision
94062 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Wed Mar 20 22:19:11 2002 UTC (6 years, 5 months ago) by
jim
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 72904 byte(s)
Diff to
previous 94061
(
colored)
Fold the compiled-in knowledge of the allowable AcceptMutex settings into
its help entry. Requires the use of a extern string rather than a function
call for the initialization to be valid in the macro (Thx to Jeff!).
In the meantime, bump down the error logging until we deal with true
default and configured setting information ala 1.3.
PR:
Obtained from:
Submitted by:
Reviewed by:
Revision
94059 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Wed Mar 20 19:53:18 2002 UTC (6 years, 5 months ago) by
trawick
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 73003 byte(s)
Diff to
previous 94055
(
colored)
write a debug message to the log when we're stuck in the sicko state
of trying to take over scoreboard slots that aren't going to be released
(we could also be stalled while taking over slots if a thread in child
gracefully terminating is serving a long-running request)
update a comment describing the sicko state to remove any information
I'm not absolutely sure of
Revision
94031 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Wed Mar 20 03:54:25 2002 UTC (6 years, 5 months ago) by
trawick
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 72442 byte(s)
Diff to
previous 94030
(
colored)
Make the listener thread stop accepting new connections and exit
cleanly at graceful restart time. This is a basic requirement of
reliable graceful restarts (the kind that won't drop connections).
This allows a future fix to make worker threads hang around until
they service all connections previously accepted by the listener
thread.
The old mechanism of doing a dummy connection to wake up the
listener thread in each old child process didn't work. It didn't
guarantee that (in the main thread) the byte was read from the pod
and global variables were set before the listener thread grabbed
the connection. It didn't guarantee that a child process in the
new generation didn't get some of the dummy connections.
Rather than burn extra syscalls adding a unique socket or pipe
to the poll set (and breaking single listen unserialized accept
in the same change), this uses a signal sent from the main thread
to the listener thread to break it out of the poll or accept.
(We don't worry about breaking it out of the optional mutex because
the child process holding the mutex will break out of poll/accept
and release the mutex, allowing a child blocked in the mutex to
get it. Eventually all children blocked in the mutex will come
out.)
Since the listener thread now exits reliably, the main thread
joins it.
PR:
Obtained from:
Submitted by:
Reviewed by:
Revision
94030 -
(
view)
(
download)
(
annotate)
-
[select for diffs]
Modified
Wed Mar 20 03:38:07 2002 UTC (6 years, 5 months ago) by
trawick
Original Path:
httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 69519 byte(s)
Diff to
previous 94025
(
colored)
get the start thread to exit when we have reached termination but
it is still trying to create worker threads
previously, after a non-graceful restart followed by a terminate
you could see a bunch of log messages showing the parent repeatedly
sending SIGTERM and finally SIGKILL to one or more children...
with this change, the sequence of messages should stop very soon
add a comment to start_threads() describing a current problem