1
0
mirror of https://github.com/apache/httpd.git synced 2026-01-26 19:01:35 +03:00
Commit Graph

995 Commits

Author SHA1 Message Date
Paul J. Reder
78ae2a9eb4 PR:
Obtained from:
Submitted by:	Paul J. Reder
Reviewed by:

Remove the MPM_SYNC_CHILD_TABLE macro since there is no longer a scoreboard
file that needs to be synched.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94308 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 16:15:33 +00:00
Jim Jagielski
70bb2575ea 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:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94306 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 14:33:50 +00:00
Cliff Woolley
3e2ce19baf 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94304 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 08:17:26 +00:00
Jeff Trawick
97659630cc 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94232 13f79535-47bb-0310-9956-ffa450edef68
2002-03-27 20:37:32 +00:00
William A. Rowe Jr
4dd3d43b9c Somewhere about server/main.c rev 1.54, we lost the stop|shutdown|uninstall
when the .conf file is missing or horribly corrupt.  Move those actions
  into the rewrite args phase so we don't trip over a missing .conf file,
  we couldn't care less if we are stopping/uninstalling Apache.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94189 13f79535-47bb-0310-9956-ffa450edef68
2002-03-26 20:13:37 +00:00
William A. Rowe Jr
71a2c46459 -i and -u were deprecated some time ago, they still work in 1.3, but
shouldn't be expected to work in 2.0.  Replacement command line options
  are -k install|uninstall


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94161 13f79535-47bb-0310-9956-ffa450edef68
2002-03-25 19:05:59 +00:00
Bill Stoddard
d317a65c5b Tag some pools.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94139 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 20:23:00 +00:00
Jeff Trawick
db1f8661e6 document yet another worker MPM glitch
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94117 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 03:43:22 +00:00
Ryan Bloom
ba4014adba Port the -k config option to Apache 2.0. This allows users to reconfigure
their service after it has been installed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94113 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 01:28:01 +00:00
Jeff Trawick
61c0797041 remove some unnecessary, commented-out code; add a comment
about a use of signals


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94112 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 01:12:49 +00:00
Jeff Trawick
4867fb1974 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94106 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 19:12:54 +00:00
Jeff Trawick
d1122ee9cc 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94095 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 16:31:39 +00:00
Jeff Trawick
533551f8a7 document a glitch that prevents complete graceful termination of the
process when one of the threads encounters a critical error


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94094 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 16:18:11 +00:00
Jeff Trawick
3289de6264 make the comment for the call to apr_signal_thread() a little more
correct about what it is going to do


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94091 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 16:06:51 +00:00
Jeff Trawick
ca62366801 fix a comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94088 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 15:27:31 +00:00
Jeff Trawick
1e799a88e6 axe some unused fields in ap_queue_t
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94087 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 15:19:54 +00:00
Jeff Trawick
5ffc63f688 don't log a failure of ap_queue_pop() at termination; it is
expected


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94068 13f79535-47bb-0310-9956-ffa450edef68
2002-03-21 03:40:23 +00:00
Jeff Trawick
c366452ca7 in a worker thread, don't dare try to process a connection if
ap_queue_pop() failed...  csd is not cleared by ap_queue_pop()
so checking csd is not helpful


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94067 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 23:29:13 +00:00
Jim Jagielski
730e99e461 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:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94062 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 22:19:11 +00:00
Jeff Trawick
eada6f8255 no need to kill the scoreboard cleanup anymore on graceful
restart; the scoreboard is longer-lived
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94061 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 20:38:52 +00:00
Jeff Trawick
e8dc265c9a 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94059 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 19:53:18 +00:00
Jim Jagielski
a65170a84c Bring 2.0 up to parity, a bit, with how much info we provide to
the admin regarding valid values for AcceptMutex. Should also
tell 'em what "default" actually maps to, but that can wait.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94055 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 16:44:13 +00:00
William A. Rowe Jr
cb7bb7bb8c No sense in opening this event when it's already opened in the parent.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94050 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 07:49:02 +00:00
William A. Rowe Jr
0a28d5809d More process lifetime changes, and simplify some ambigious cruft.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94046 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 06:55:39 +00:00
William A. Rowe Jr
cda6c47f99 Fix a few listener-related lifetime issues [they are created in the
open logs phase, only once.]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94041 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 06:14:19 +00:00
William A. Rowe Jr
cec6d4b870 The pre_mpm hook creates server-lifetime objects (or at least, for the
generations across graceful restarts.)  They should use the process pool.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94039 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 05:58:21 +00:00
William A. Rowe Jr
1ab2f45a70 When restarting [always graceful on Win32], we don't repeat pre_mpm
(Unix doesn't, we shouldn't either.)  [Ryan Bloom]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94032 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 04:29:55 +00:00
Jeff Trawick
ae65c40d8e 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:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94031 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 03:54:25 +00:00
Jeff Trawick
f8827903aa 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94030 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 03:38:07 +00:00
Jeff Trawick
32fe8d097f be a little more specific in a thread-create error message
it is helpful to distinguish between a failure creating the
first thread (listener) vs. a failure creating one of n
worker threads


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94025 13f79535-47bb-0310-9956-ffa450edef68
2002-03-19 22:09:26 +00:00
Jeff Trawick
cfcab38a77 "apachectl stop" shouldn't send the gracefully-terminate char down
the pod...  the child processes need to know that it isn't a graceful
termination and they shouldn't wait for old connections to finish


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94024 13f79535-47bb-0310-9956-ffa450edef68
2002-03-19 21:31:04 +00:00
Jeff Trawick
80788ba82a get rid of unnecessary code to track the number of worker threads
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94017 13f79535-47bb-0310-9956-ffa450edef68
2002-03-19 17:56:57 +00:00
Jeff Trawick
928aff8a02 Fix a hang condition with graceful restart and prefork MPM
in the situation where MaxClients is very high but
much fewer servers are actually started at the time of the
restart.

The way we notify an entire generation to die at once is
changed so that we don't have to use the pod (and deal with
the ease of filling the kernel pipe buffer).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93999 13f79535-47bb-0310-9956-ffa450edef68
2002-03-18 18:24:55 +00:00
Jeff Trawick
67f3ac2762 prefork and worker:
after allocating a new scoreboard, make sure the right generation
is stored in the global score


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93998 13f79535-47bb-0310-9956-ffa450edef68
2002-03-18 18:12:43 +00:00
William A. Rowe Jr
d07e31f81f Simplify s/APR_OS_PROC_T_FMT/APR_PID_T_FMT/, apr_os_foo entities aren't
for external consumption.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93969 13f79535-47bb-0310-9956-ffa450edef68
2002-03-16 18:42:46 +00:00
William A. Rowe Jr
abaf919813 Axe unused variable
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93961 13f79535-47bb-0310-9956-ffa450edef68
2002-03-15 20:34:30 +00:00
Sander Striker
50ba0ce732 Update the mpms to call the new allocator/pools API
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93943 13f79535-47bb-0310-9956-ffa450edef68
2002-03-15 00:50:31 +00:00
Bradley Nicholes
da65586a94 Added code to extract the current address space name so that each
instance of Apache can be identified by the address space that it is running in


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93934 13f79535-47bb-0310-9956-ffa450edef68
2002-03-14 16:48:19 +00:00
William A. Rowe Jr
2a0e4fd83c Some lingering debug cruft that isn't needed
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93930 13f79535-47bb-0310-9956-ffa450edef68
2002-03-14 04:43:11 +00:00
William A. Rowe Jr
c46662465d Use fprintf to stderr over printf. Better yet - replace with the
logger, but my brain just isn't quite there tonight.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93929 13f79535-47bb-0310-9956-ffa450edef68
2002-03-14 04:37:14 +00:00
William A. Rowe Jr
f2e2cdcdb8 My [sixth?] major revamp of service.c. Traded an event for a mutex
to the service_init completion, expanded timeouts, moved SERVICE_STOPPED
  message posting to the main thread since sometimes, in odd cirumstances,
  our SCM thread wasn't resumed prior to termination, and ripped the code
  for the stderr logs to use nt_eventlog.c instead.  And generally tried
  to make the code just a little bit more grokable [as if such a thing
  is really possible.]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93928 13f79535-47bb-0310-9956-ffa450edef68
2002-03-14 04:34:03 +00:00
William A. Rowe Jr
3dab10782e Cleanup the eventlogger code, and split it into its own source.
[got the copyright correct, no less.]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93927 13f79535-47bb-0310-9956-ffa450edef68
2002-03-14 04:19:00 +00:00
William A. Rowe Jr
6d0a9307b3 Now that we test ownership of the listeners in listen.c, -k "start"
can no longer hang on to the listeners after it checks that they are
  free.  Also, we cannot be checking listeners if we are using -k "config"
  to alter the service config, since the service might be running as we
  try this, and we cannot check the listeners in -k "restart", since we
  are pretty certain they are owned by the running service we are about
  to try restarting..


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93926 13f79535-47bb-0310-9956-ffa450edef68
2002-03-14 04:12:12 +00:00
William A. Rowe Jr
fa3ba046f1 The be-certain-we-own-the-socket patch to listen.c fails if we hang
on to the originals after duplicating sockets.  If you dup, you aught
  to be closing the source.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93925 13f79535-47bb-0310-9956-ffa450edef68
2002-03-14 04:08:51 +00:00
Roy T. Fielding
845cbfd508 Update our copyright for this year.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93918 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 20:48:07 +00:00
Jeff Trawick
53d837b39b simplify the way we find the family of an apr_sockaddr_t
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93884 13f79535-47bb-0310-9956-ffa450edef68
2002-03-12 23:15:54 +00:00
Justin Erenkrantz
3058b601ff As hinted on dev@httpd, change filter naming schemes to match our
expectations of their usage.

The reason that we should make this change now is that we have changed
the implied meaning of AP_FTYPE_HTTP_HEADER - some users of this should
be PROTOCOL while others should be CONTENT_SET.  In order to clarify it,
toss all of the bogus names and force the filter writers to make sure
they understand what they are doing.

CONTENT_SET is new (horrible name - change if you have better idea), but
it indicates that it should run between RESOURCE and PROTOCOL.
mod_deflate is the ideal CONTENT_SET filter.

The changed type names are:
CONTENT is now RESOURCE.
HTTP_HEADER is now PROTOCOL.  However, most filters that used HTTP_HEADER
may want CONTENT_SET.  (Only things like POP and HTTP belong as PROTOCOL.)

MMN bump since all filters need to be recompiled due to filter reordering.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93756 13f79535-47bb-0310-9956-ffa450edef68
2002-03-07 09:27:17 +00:00
Jeff Trawick
04bde59aaf failures on the accept mutex are common at restart time, so be smart
about the log level and use APLOG_DEBUG if we're restarting


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93720 13f79535-47bb-0310-9956-ffa450edef68
2002-03-05 21:18:07 +00:00
Jeff Trawick
152c269699 fix a typo in a log message... the message claimed that apr_proc_mutex_lock()
failed when actually it was apr_proc_mutex_unlock() which failed


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93719 13f79535-47bb-0310-9956-ffa450edef68
2002-03-05 21:01:24 +00:00
Jeff Trawick
da3ac1a6e5 skip the lock release if the lock obtain failed
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93718 13f79535-47bb-0310-9956-ffa450edef68
2002-03-05 20:51:50 +00:00