Modify the worker MPM to not accept() new connections until
there is an available worker thread. This prevents queued
connections from starving for processing time while long-running
connections were hogging all the available threads.
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.
After review and testing against all of the PSDK examples (see
http://www.apache.org/~wrowe/ for commentary on building the
examples and making them work) ... this disable-optimization
should no longer be required.
Added a check to make sure that h_aliases is not NULL before we try to
dereference it in the for(...) loop. Attempting to dereference a NULL pointer
was causing a fault if there were no aliases found.
Graham Leggett [Fri, 26 Apr 2002 21:54:38 +0000 (21:54 +0000)]
Apply a patch to compile cleanly again against changes to the shared memory
implementation in APR.
PR:
Obtained from:
Submitted by: Eduardo Garcia Lopez <egarcia@stream18.com>
Reviewed by:
Convert the worker MPM's fdqueue from a LIFO back into a FIFO. Since
elements in the queue represent accept()ed connections, we want them
to be processed in the order that they were received. (I erroneously
converted it to a LIFO quite awhile ago in the hopes that it would
improve cache efficiency.)
Remember to perform a make clean in the worker directory after this patch,
since this patch changes the size of the fd_queue_t object (which is
allocated in worker.c).
Some of these worker bugs may or may not be showstoppers, but I'll let
Striker decide that. I hope to have the top two of these finished in
the next 24 hours, but the third I may need some help with.
Not yet added to the default build, but curious if they build and run.
mod_deflate tested with both zlib 1.1.3/1.1.4, unpacked in srclib/zlib/.
Zlib only seems to have .dll builds, not very efficient when a single
binary is built against sources, so we compile the appropriate sources.
Your mileage may vary.
I just posted a few bug fixes that need to go into the worker MPM, so
I'm -1 here until those are fixed. I also think we need to do a lot more
load/soak/burn testing on worker before we switch it to be the default.
(and maybe by that time we'll have a better candidate for the hybrid
MP/MT MPM).
During the 1.3->2.0 migragrion; ab its #defined VERSION own string was replaced
by that of the base server distribution it sits in. Propably by accident.
This is propably not a good idea - as ideally one would like to be able to compare
ab runs as much as possible - even across releases of apache 2.0 - assuming ab or
the dependent APR has not changed (note to self: we do not track APR in our version
structure). This commit decouples the version strings for now. Though the actual
value may be nicely confusing.
Fix suexec invocations from userdir - the ~ was not being prepended to the
uid per our convention. Therefore, bad things would happen (like we
wouldn't cd to the right directory).
Add a flag to the ap_unix_identity_t structure to indicate if we are in
a userdir - if so, prefix the ~.
(Modified by Justin, but Colm's patch pointed me in the right direction.)
Since UserDir is a raw argument, our config system allows it to be blank.
To save us all the hassle, just flat out reject this silliness. We could
treat blank as ".", but let the user shoot themselves in the foot
explicitly (and don't give them any ideas on how to do it).
We must always use case-insensitive comparisons in mod_mime even if
our platform is not "case-blind." This matches 1.3 behavior and our
docs say that the extension argument is case-insensitive anyway.
This is case where the code fix is easier than the doc fix. =)
Brian Havard [Thu, 25 Apr 2002 03:16:44 +0000 (03:16 +0000)]
Get proxy protocol modules to build on OS/2. This adds the mod_proxy dll's
import library to the link, making the public symbols in it available to the
protocol modules at build time.
Major improvement in concurrent processing for AB:
- Enable non-blocking connects.
- Prevent quasi-blocking mode apr_recv (which would prevent AB from
multiplexing over the entire descriptor set).
- Catch other fatal apr_recv() errors.
[This patch is slightly different than the one posted to the dev list,
but regardless thanks to the many people who reviewed this.]
A bug affecting any platform that had pre-lstat'ed the file or directory
in question. We neglected to clear the FINFO_LINK bit that told us this
was lstat()ed, but also causes stat() to follow an lstat() approach.
This is part 2 of 2 to correct the NTFS Junction (symlink) bug.
Bugz report 8014, identified by Sam Morris <sam@netcity.co.uk>
Clarify the remaining problems with Range: headers. The seg faults went away
when we changed ap_send_error_response to get rid of resource filters.
This was triggered because we generate a lot of invalid 416 responses for SSI.
That happens because the complete length of the entity body (response) isn't
known accurately until after the C/L filter runs. That's C/L's job, after all.
Flipping the order of the byterange and C/L filters fixes the invalid
Content-Range headers and 416's. But then the Content-Length header contains
the full length, rather than the sum of the returned ranges. That's wrong, but
doesn't seem too hard to fix.
Ryan Bloom [Mon, 22 Apr 2002 18:57:12 +0000 (18:57 +0000)]
Fix perchild MPM so that it can be configured with the move to the
experimental directory. Fix perchild MPM so that it uses ap_gname2id
for groups instead of ap_uname2id.
Small optimization, if we are behind (at the 5th segment, for example),
catch up the segment-count-sorted directory list without string compares.
Mostly affects win32 which jumps from seg 0 (root) to 4 for UNC path names.
AcceptPathInfo was totally backwards... it would reject when set to on and
by default and accept when set to off for the default handler, and would
reject only if set to accept for mod_cgi(d) and mod_isapi.
Brian Pane [Mon, 22 Apr 2002 04:48:11 +0000 (04:48 +0000)]
Skip a potentially heavyweight call to sysconf, plus some
local variable initializations, in the common case where the
request is not for the server status page
Bill Stoddard [Mon, 22 Apr 2002 03:25:40 +0000 (03:25 +0000)]
Added the APLOG_TOCLIENT flag to ap_log_rerror() to
explicitly tell the server that warning messages should be sent
to the client in addition to being recorded in the error log.
Prior to this change, ap_log_rerror() always sent warning
messages to the client. In one case, a faulty CGI script caused
the server to send a warning message to the client that contained
the full path to the CGI script. This could be considered a
minor security exposure.
Brian Pane [Sat, 20 Apr 2002 20:41:33 +0000 (20:41 +0000)]
Workaround to get leader/follower compiling on recent Linuxes:
apr_atomic.h includes some <asm/*.h> header files that clash
with stdlib.h, so I've moved apr_atomic.h so that it's included
after all the other header files.
Propogate the change to insert "bucket_" into the names of the
static functions that operate on various bucket types to make
backtraces more sensible-looking.
showstoppers+=2; :-( ...but these might have already been fixed, I just
never got a response on-list about them and wanted
to note them somewhere where they wouldn't be
forgotten
Paul J. Reder [Fri, 19 Apr 2002 19:16:23 +0000 (19:16 +0000)]
Moved the call to apr_mmap_dup outside the error branch so
that it would actually get called. This fixes a core dump
at init everytime you use the MMapFile directive. [Paul J. Reder]
Jeff Trawick [Fri, 19 Apr 2002 18:31:20 +0000 (18:31 +0000)]
Trigger an error when a LoadModule directive attempts to
load a module which is built-in. This is a common error when
switching from a DSO build to a static build.
SOCKETs are HANDLEs, but they type mismatch. This fix has now been
verified by the vast majority of folks complaining about the "Not a
handle" failures in WSADuplicateHandle, later in the code flow.
Jeff Trawick [Fri, 19 Apr 2002 14:04:30 +0000 (14:04 +0000)]
Change instdso.sh to use libtool --install everywhere and then
clean up some stray files and symlinks that libtool leaves around
on some platforms. This gets subversion building properly since
it needed a re-link to be performed by libtool at install time,
and the old instdso.sh logic to simply cp the DSO didn't handle
that requirement.
Submitted by: Sander Striker
Reviewed by: Jeff Trawick
Brian Pane [Fri, 19 Apr 2002 08:02:00 +0000 (08:02 +0000)]
Some code transformations to improve the generated assembly
code within the critical region inside the spin locks. (Shortening
this code path reduces the probability that we'll have to spin.)
Switch ap_http_filter to use ap_get_brigade and apr_brigade_flatten
instead of ap_getline - this prevents some odd looping issues that
can cause problems.
Also, when we call get_mime_headers to read the trailers, we need
to reset our ctx->state to BODY_NONE - there should only be MIME-header
information (followed by a blank CRLF line) - and we don't know
how much data there will be - so it is by definition BODY_NONE.
Simplify last commit by only calling cat once (this should hopefully resolve
rbb's concern about maintainability and still address mine about annoying /s).
Don't call mkdir when we are the top-level directory. We *have* to have
been created before hand.
Replace this bogus check with something that actually works. I have no
idea what this line is attempting to do, but it doesn't work in the
top-level Makefile - causing an error. Therefore, take the line we use
in APR to check if a file exists.
The pedant in me wishes to see all extraneous trailing / go away.
So, if we are in the top-level makefile, don't add an extra trailing
slash to srcdir, builddir, or VPATH. It's annoying.