b01b079cd910e1172303b13d5d04863bed32e98b 1662437 |
|
26-Feb-2015 |
ylavic |
mpm_{worker,prefork}: save some cycles by not copying the listener's pollfds
for each pollset operation.
We don't need a copy when poll()ing if those are allocated with the correct
lifetime (the listener thread) at the very beginning. |
4eef6beb03696daf61707faba813fe6b86152d6b 1643179 |
|
05-Dec-2014 |
ylavic |
mpm_{prefork,worker}: follow up to r1635521.
Don't crash when there is no accept mutex (one listener => apr_proc_mutex_name(NULL)). |
5022bc317781314105104f6881f823e5d6d64e66 1640763 |
|
20-Nov-2014 |
ylavic |
mpm_event(opt), mpm_worker, mpm_prefork: follow up to r1635521, r1640161.
Retain num_buckets and max_buckets accross restarts so that we can determine
whether new buckets were allocated and set their idle_spawn_rate at the same
level as the existing ones (max).
Also, adjust ap_daemons_limit and ap_daemons_to_start lower bounds at mpm_run()
time, once num_buckets is available for the current generation (previously done
at check_config time, hence before num_buckets is computed, and then with the
previous generation's value). |
b9fcb4dd4b14369c068443f93b13671d56ad1588 1640161 |
|
17-Nov-2014 |
ylavic |
mpm_event(opt), mpm_worker: follow up to r1635521.
Allocate retained idle_spawn_rate vector on the process pool. |
b4e571e0114742b6e02aacf6142af7fa31a6038e 1640145 |
|
17-Nov-2014 |
ylavic |
mpm_worker, mpm_prefork: follow up to r1635521.
Use one dedicated accept mutex per listeners bucket. |
a742cbb3e85669473b3233f30e3978bb6a20083c 1635521 |
|
30-Oct-2014 |
ylavic |
MPMs, core: make duplicated listeners (SO_REUSEPORT) introduced in r1599531
less intrusive.
Submitted by: Yingqi Lu <yingqi.lu@intel.com>
Modified/Committed by: ylavic
Add ListenCoresBucketsRatio which is a configurable ratio between the number of
CPU cores (online) and the number of listeners buckets to create, defaulting to
zero (so that listeners buckets become an opt-in, ie. ncpus / ratio > 1).
This could also be made an opt-out by using the previous hardcoded value (8) as
default.
Make ap_close_listeners() act on all the listeners (including duplicated ones),
since the function is also called externally (eg. mod_cgid, mod_ssl_ct and
possibly any third party module) to cleanup opened descriptors when a process
is forked (the duplicated listeners are kept in a scoped/static variable).
Add ap_close_listeners_ex() to close a single bucket of listeners, used by the
children to close unused duplicates and internally by ap_close_listeners().
Make ap_duplicate_listeners() compute the number of buckets to be used, instead
of each MPM. This number is now based on the above ratio and will not change
unless asked to (given *num_buckets < 1, that is when the MPM does not run in
one-process mode nor after a graceful restart).
Remove some global variables (mpm_listen, enable_default_listeners) previously
used to communicate between MPMs and ap_listen, since ap_duplicate_listeners()
API can now be used to do so.
Also rename num_buckets as ap_num_listen_buckets, and prefix have_so_reuseport
with ap_ (both printed by ap_log_common(), hence kept global).
Detect ap_have_so_reuseport once only at startup.
Restore dummy_connection() as before r1599531 since sending POD signals should
not depend on the number of listeners buckets (there is still one single socket
receiving the connections).
For each MPM (concerned), move the bucket data (pod, listeners and eventually
accept mutex) into a struct and instanciate an array of them (sized by the
number of buckets), for each child to use its own data according to its bucket
index, and the parent to maintain the whole. |
8e96fb3f467d3ac42d06316ced4edc705ba30127 1629990 |
|
07-Oct-2014 |
ylavic |
core: follow up to r1629909: fix min_spare_threads lower bound and check wrt num_buckets. |
6f2b40c28d377deb94c65a9787d8a1bf0de43078 1629925 |
|
07-Oct-2014 |
ylavic |
core: ensure that MPMs return an error on runtime failure and hence that
httpd's main process also exits with an error. |
a94a0f8604bc182459825c18b5574236ea2673c7 1629918 |
|
07-Oct-2014 |
ylavic |
mpms: enforce assertion that unreachable code is not reached. |
60f145444e00399b806c6e1329689ae57603a664 1629909 |
|
07-Oct-2014 |
ylavic |
core: Use process scoreboard to store each child's listener bucket,
and silently adjust the configured number of processes/threads to
be above the computed number of listener buckets (depending on the
CPU cores). |
9a6ab821d6bee8cf962790875d8bdbfa0be05697 1620569 |
|
26-Aug-2014 |
jkaluza |
worker MPM: Fix null-dereference crash when using -DFOREGROUND with worker MPM |
37d595a87da5e80d34461b837be7d7cb95e6aa82 1602826 |
|
16-Jun-2014 |
ylavic |
Mark all unused/duplicated/closed child listeners as inactive.
Fix unused "ap_listen_rec *lr;" in worker_run(). |
8d789368da20a66ee5b97075d5959384aff6b5e6 1601170 |
|
08-Jun-2014 |
ylavic |
-MPMs prefork & worker: avoid segfault with SAFE_ACCEPT in ONE_PROCESS mode. |
a5af0c977b5a7ad47a8b4b0ac149080bec79b32d 1600656 |
|
05-Jun-2014 |
jim |
fix restart issues |
3a2bc69dbf5d2afe57bcc21c554aa1e3851fb159 1599641 |
|
03-Jun-2014 |
jim |
Break out common code to be share-able |
776e24ab929f0ce906e43a0d2cf4b1f7a2d6b56b 1599603 |
|
03-Jun-2014 |
jim |
Now allow MPMs to call ap_log_common() |
3c990331fc6702119e4f5b8ba9eae3021aea5265 1599531 |
|
03-Jun-2014 |
jim |
Optimize w/ duplicated listeners and use of SO_REUSEPORT
where available. |
72aa636f8d3b8f136d8442b914309889a9623bfe 1594301 |
|
13-May-2014 |
mrumph |
Fix some comment typos |
aba55cd5d565f6f00a3d0e17c5724fdd3a50827f 1526220 |
|
25-Sep-2013 |
trawick |
worker MPM: Don't forcibly kill worker threads if the child process is
exiting gracefully.
Submitted by: Oracle, via trawick
This modification was made some years ago for Oracle HTTP Server
by an Oracle employee. |
e41052c690b57472c6e0a7170a2fc4faaeccca48 1433682 |
|
15-Jan-2013 |
jailletc36 |
Log a warning if ThreadStackSize has an inappropriate value.
PR : 54311
Submitted by: Tianyin Xu <tixu cs ucsd edu>
Only event.c has been compiled on my system. The 2 others are just cut and paste.
I have left the same value for APLOGNO in event and eventopt has for the other logged messages. I don't know if it is the right way to do. |
54950bd366f8b147b488a94dd197de9fc751e119 1410004 |
|
15-Nov-2012 |
jim |
missed one |
554a8bb940c6c9968d9b75c45a0e549cbf49ba61 1409273 |
|
14-Nov-2012 |
jim |
no longer needed |
7cc77074d12e6ed11433da96af0df1e1a27e9b3d 1409214 |
|
14-Nov-2012 |
jim |
Pull out the "extended" pod functions used by event and worker
to core, since it will be used by Simple and Lean and
likely other MPMs. Avoid duplication. |
6cefee0444e9a5ab866271b09846ba8ae954d933 1364601 |
|
23-Jul-2012 |
trawick |
Follow up to r1363557:
Refactor with some existing code to slightly optimize thread tracking.
Fix an implementation problem affecting statically linked MPMs which
would break the ability to fail restart if a resource shortage was
found immediately.
Found by: rjung |
65a32053cbb747cf0314ac3f655da8c7386b229e 1363557 |
|
19-Jul-2012 |
trawick |
mpm_event, mpm_worker: Remain active amidst prevalent child process
resource shortages.
This is a somewhat different direction than r168182 ("transient thread
creation errors shouldn't take down the whole server").
r168182: If APEXIT_CHILDSICK is received and there aren't any
active children at the time, exit.
Now: If APEXIT_CHILDSICK is received and we never successfully
initialized a child, exit.
The issue seen with the r168182 handling is that it is rather easy
to be left with no active child processes (which causes the server
to exit completely) during a resource shortage that lasts for some
measurable period of time, as contrasted with a resource shortage
that results in only a handful of allocation failures.
Now the server will remain active, though as long as the resource
shortage exists children may continually fail and the parent will
try once per second to create a replacement. The existing logic
to reduce the spawn rate after such errors will prevent the
parent from trying to create children more rapidly. |
383f563d00eccc1bf3f5283b346d8a232b81a265 1363440 |
|
19-Jul-2012 |
trawick |
mpm_event, mpm_worker: Fix cases where the spawn rate wasn't reduced
after child process resource shortages.
The broken scenario:
child X exits with APEXIT_CHILDSICK
another child Y is created and reuses child X's scoreboard slot
child X's exit status is processed
The case that worked is when child X's scoreboard slot hadn't
been reused by the time that its exit status was processed. |
185aa71728867671e105178b4c66fbc22b65ae26 1209766 |
|
03-Dec-2011 |
sf |
Add lots of unique tags to error log messages |
64322eb848eab3b57780bf40340346820104db58 1200140 |
|
10-Nov-2011 |
trawick |
revert accidental commit 1200129 |
9e31b451f1271bc6310970095ae5bc33cb341aa1 1200129 |
|
10-Nov-2011 |
trawick |
clean up unused ap_my_generation variable
(presence is odd, since this variable as an API was supposedly removed
long ago, and a similarly named static variable was removed in r1078286) |
e9356fde2e4fff8dab7eb6006ed1c476973796c5 1180742 |
|
10-Oct-2011 |
sf |
If a child is created just before graceful restart and then exits because
of a missing lock file, don't shutdown the whole server.
PR: 39311
Submitted by: Shawn Michael <smichael rightnow com> |
5bfaaf573bacb45c1cf290ce85ecc676587e8a64 1174751 |
|
23-Sep-2011 |
jim |
Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change |
3a59bb90be3bc6246632384c3d885b875ae507d5 1172686 |
|
19-Sep-2011 |
sf |
Add wrappers for malloc, calloc, realloc that check for out of memory
situations. Use them in most places where malloc, and friends are used.
This results in clean error messages in an out of memory situation instead of
segfaulting or silently malfunctioning. In some places, it just allows to
remove some logging code.
PR 51568, PR 51569, PR 51571. |
099d298d417b68b3d11fb5934c404c60f518d69c 1151234 |
|
26-Jul-2011 |
sf |
Install signal handlers for crashes before detaching. Previously, there
was a time span where crashes would be neither visible on the console nor
logged in the error log. |
0d54de55e9fec3d9ac5989a5fe016f349b82ed05 1151233 |
|
26-Jul-2011 |
sf |
Reduce period during startup and restart where a successive signal may be lost
PR: 43696
Submitted by: Arun Bhalla <arun shme net> |
a041174c92fec6d5e37496ae7f5fe0d2ea946147 1137813 |
|
21-Jun-2011 |
sf |
Log the deprecation warning at level info, not warn |
5cd5205744c3596d29d29271073381e6b5ec0723 1137757 |
|
20-Jun-2011 |
sf |
Fix search'n'replace error: Actually warn if MaxClients is used |
3fa816e4832a1c70600bdfd6fc5ef60e9f1c18bb 1137744 |
|
20-Jun-2011 |
sf |
Rename MaxClients to MaxRequestWorkers which describes more accurately what
it does. |
925a6d92173ab96cdb0a8976c7aac13ef809e218 1096609 |
|
25-Apr-2011 |
trawick |
Add child_status hook for tracking creation/termination of MPM child
processes. Add end_generation hook for notification when the last
MPM child of a generation exits.
end_generation is implemented completely by core using the
child_status hook run by the MPM.
simple and mpmt_os2 MPMs don't currently run the child_status
hook, so neither hook is invoked with those MPMs. |
133a47776e6bc3f11f3beac454e643240b675ff7 1087085 |
|
30-Mar-2011 |
trawick |
Simplify the interface to ap_reclaim_child_processes() and
ap_relieve_child_processes(): instead of requiring the MPM
to implement an otherwise-useless hook, just use a callback
function.
As I don't expect third-party MPM devs are following our day
to day progress, the API changes are considered part of
yesterday's MMN change. |
8f29f672255fe76964af126f9ac8c3c864274fa0 1086293 |
|
28-Mar-2011 |
trawick |
mpm_common.c implements a handful of config directives; the
related state has to be re-initialized to the default values
at pre-config time, but that was handled inconsistently by
the MPMs, resulting in unexpected behavior when some of the
directives were removed across restart
move that necessary initialization from the MPMs to common
code run from core's pre-config; MPMs that need to override
defaults can do so by running after core's pre-config (the
NetWare MPM now does that)
the DEFAULT_MAX_REQUESTS_PER_CHILD compile setting wasn't useful
enough to keep
the simple MPM wasn't consistent in which of these directives
were respected and which weren't, and that hasn't changed
(see procmgr.max_requests_per_child vs. ap_max_requests_per_child) |
20e0c71be778348516719e1e58a9f55c8e78c570 1086224 |
|
28-Mar-2011 |
trawick |
consolidate logic to remove the pidfile in a new API,
ap_remove_pid(), related to existing ap_log_pid() and
ap_read_pid()
presumably this is useful to third-party MPMs as well |
814ea5b3442a2b48539f390ef51fe7bf0fc5c351 1084000 |
|
21-Mar-2011 |
jorton |
* server/mpm/prefork/prefork.c (set_signals): Ignore SIGXFSZ; have a
write() beyond 2GB fail with E2BIG rather than killing the process
in the now hopefully rare case of non-LFS file usage on LFS systems.
* server/mpm/worker/worker.c (set_signals): Likewise.
* server/mpm/event/event.c (set_signals): Likewise. |
efc81fe729a2b7401028387da184b4a98f0b854a 1078286 |
|
05-Mar-2011 |
trawick |
worker, event, prefork: Correct several issues when built as
DSOs; most notably, the scoreboard was reinitialized during graceful
restart, such that processes of the previous generation were not
observable.
Other noticeable ones:
* the generation number did not increment properly
* worker's check-config hook didn't detect startup properly,
so messages about inconsistent directives could have been sent
to the wrong place
max_daemons_limit wasn't tracked across restart, but as the scoreboard
was always cleared this was a non-issue.
Reinitialization of idle_spawn_rate, hold_off_on_exponential_spawning,
and maxclients-message-reported may or may not have been features,
but the big picture is that the behaviour shouldn't have differed.
These changes should have been part of r758185. |
403a74516d626da5c7e1b8f364eb730c7142f4cc 1078285 |
|
05-Mar-2011 |
trawick |
zap needless reinitialization of is_graceful on the 2nd
call of the open-logs hook |
740a330a0d543c80086bb3ba9add6e93af69714d 1078170 |
|
04-Mar-2011 |
trawick |
sanity check use of volatile in prefork, worker, and event |
d091e4531ccd531dadc35351c0742973713ab2fd 1076614 |
|
03-Mar-2011 |
trawick |
worker: child_main() never returns, so remove some dead code after
one of the calls |
be192cefa381d5bae6868034687471754cb43175 1021924 |
|
12-Oct-2010 |
sf |
Rename MaxRequestsPerChild to MaxConnectionsPerChild, which
describes more accurately what the directive does.
The old name still works but logs a warning. |
36ef8f77bffe75d1aa327882be1b5bdbe2ff567a 951895 |
|
06-Jun-2010 |
sf |
Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels |
1c3c8adce81485d249d42c30d166c13da88853d6 951866 |
|
06-Jun-2010 |
rjung |
Silence compiler warning. |
6c9c71bf24788b6d2d1aecb01cccae094d15f5ae 941454 |
|
05-May-2010 |
trawick |
fix compile failure in r940981 |
024e70e05386a6367eb45d0d1cc406764520ff4c 940981 |
|
04-May-2010 |
wrowe |
Catch up with ap_[proc|global]_mutex_create api change |
57713c26f79ee40e18f060d3725b02cf229233d5 922405 |
|
12-Mar-2010 |
covener |
all signs indicate that status value is always -1 on error |
43f18c24a8f6f42cdacc336d4344c7c64b3929d5 922392 |
|
12-Mar-2010 |
covener |
reduce the warning level in the bindprocessor() call used to make sure child
processes aren't bound to the CPU the parent is running on.
In recent levels of AIX, the parent isn't implicitly bound to a CPU
(so the children don't inherit it), and when the AIX WPAR feature is enabled
this call can return EPERM, even though the child process is already unbound. |
bd27541a0c96caa881f17a490e23cdd220d480c8 910684 |
|
16-Feb-2010 |
poirier |
Log command line on startup, so there's a record of command line
arguments like -f. Suggested by Shaya Potter. [Dan Poirier]
PR: 48752 |
d2f2b24ad196c63257e7214b64e6a3bd947e5638 907723 |
|
08-Feb-2010 |
trawick |
change the preprocessor define ap_accept_mutex_type to upper case |
60a8830541cd85d23a42ccb1639bc4744de9d526 906535 |
|
04-Feb-2010 |
poirier |
worker: don't report server has reached MaxClients until it does.
Add warning when within MinSpareThreads.
PR: 46996 |
b6b8c27b2adcf08eca23d3b7c2de79880b816a57 894361 |
|
29-Dec-2009 |
takashi |
string constness |
11f2c481e1d57bedb3f758565307501e9a2730dd 883540 |
|
24-Nov-2009 |
trawick |
Replace AcceptMutex, LockFile, RewriteLock, SSLMutex, SSLStaplingMutex,
and WatchdogMutexPath with a single Mutex directive. Add APIs to
simplify setup and user customization of APR proc and global mutexes.
(See util_mutex.h.) Build-time setting DEFAULT_LOCKFILE is no longer
respected; set DEFAULT_REL_RUNTIMEDIR instead.
Some existing modules, such as mod_ldap and mod_auth_digest gain
configurability for their mutexes. |
40965c37b2fd320093215de6c3fbd516382077ea 818825 |
|
25-Sep-2009 |
jim |
Enhance ap_hook_monitor to pass along a server_rec (in
general the ap_server_conf) and tuck away some storage
in there which may be useful as an opaque data pointer. |
601a92edb910ac95f0980bdce887ad523649c2d5 815915 |
|
16-Sep-2009 |
gregames |
* prevent a fork bomb if the accept mutex is clobbered by exiting with
APEXIT_CHILDSICK if the worker process hasn't served any requests
* move the accept mutex error leg into its own function to take advantage of
common code and to keep rarely executed instructions out of the mainline
instruction cache. |
25d0f8adcab13255494a3572edff1a25f6fbeea3 804764 |
|
16-Aug-2009 |
rpluem |
* Do better checking of pollset operations in various places to avoid segfaults.
PR: 46467
Submitted by: Stefan Fritsch <sf sfritsch.de>
Reviewed by: rpluem |
3ec1198cf7a85eea31dbbbbe7bc5268510701f7b 765305 |
|
15-Apr-2009 |
gregames |
no longer amusing.
I'll still pay off if somebody does it legitimately, but I haven't been
to Apachecon in ages so we'll have to work out a different delivery
mechanism. With the stability of the 2.0.x and 2.2.x releases and
Moore's Law in effect for the last decade, it might be possible... |
ff32c2e8bb4918d83fdad1182dcc26eeb88d28a5 762127 |
|
05-Apr-2009 |
trawick |
main() can use ap_run_mpm() directly, so axe the old ap_mpm_run() function
change the mpm hooks to return OK/DONE instead of 0/1 |
badbab787974c883f2fff0341b4b249bbf6d57a2 760864 |
|
01-Apr-2009 |
trawick |
mpm-query hook: distinguish between DECLINED and APR_ENOTIMPL so that
. ap_mpm_query() can return APR_EGENERAL if called too early (for debugging a module)
. some hypothetical module which implements the mpm-query hook can bypass the MPM
with APR_ENOTIMPL |
ff0d250751b2f53f755070f99cbda447064ca90a 759924 |
|
30-Mar-2009 |
trawick |
rename the new retained-data APIs to ap_retained_data_create()/ap_retained_data_get(), for better
consistency with existing APIs (e.g., slotmem)
don't bother changing the MMN, which doesn't reflect recent -dev changes anyway |
66b7d26b8c3164ddd1cd1ee1d0bec6cd5780301b 759757 |
|
29-Mar-2009 |
trawick |
the mpm_get_child_pid hook is unnecessary, as was the per-MPM MPM_CHILD_PID() macro which it replaced
axe this new hook, and use ap_get_scoreboard_process() instead |
71debfa33ffaf708f3803495c4caf6b00b78ac86 759699 |
|
29-Mar-2009 |
trawick |
Core can specify a platform-specific rewrite args hook. Use that on Unix.
Windows continues to specify this in the MPM, at least until someone
can separate out the MPM-specific bits. |
8f65a478213d64b377659c263ceef21e6e61eabd 759648 |
|
29-Mar-2009 |
mturk |
Register rewrite_args hook.
Now, dunno if that was intended, but at least allow to start the httpd |
5e7eb7547ed0d6fecbe15527bba96acede5360f0 758680 |
|
26-Mar-2009 |
trawick |
prefork, worker, event:
restore expected accept mutex mechanism and allocator limit support
(the related AP_MPM_WANT_foo defines no longer exist) |
aae6ae5e5557b23552f5771aa385c5b6bb203229 758312 |
|
25-Mar-2009 |
trawick |
resurrect the old (pre-r757867) compiled-in MPM_NAME value, but via a hook for dynamically
linked MPMs |
19af44d09017c09443615b57a479ea8d80ba0e4c 758278 |
|
25-Mar-2009 |
trawick |
The rewrite-args hook isn't available to MPM DSOs. Piggy-back on the
linked-in mod_unixd.c to handle that.
(The set of MPMs modified is the same set for which mod_unixd is enabled,
which is approximately equivalent to the set of Unix MPMs which anybody has
tried to maintain in recent memory.) |
9543daa1bf345c36853642d45b2b64bf0a6b6ddd 758185 |
|
25-Mar-2009 |
trawick |
prefork, worker, and event MPMs: use retained-data API to maintain
information across reconfigs, to allow these MPMs to work as DSOs |
dd028aa8111afb6534fece555e8c2d408894671e 757853 |
|
24-Mar-2009 |
trawick |
Introduce a new set of APIs to allow MPMs to be proper modules instead
of integral parts which share global variables, functions, and macros
with the rest of httpd.
Converted now:
prefork, worker, event, simple, WinNT*
*WinNT hasn't been built or tested, and relies on a hack to include the
WinNT mpm.h to disable Unixy MPM support routines in mpm_common.c |
cdccf2ac94172d1a4a54bc2e17324e1ef682ccf3 742218 |
|
09-Feb-2009 |
pquerna |
Add conn_rec::current_thread. |
a91a59d0b0ceed7cd5621fe8757eda5ff6a043a8 722399 |
|
02-Dec-2008 |
pquerna |
API Cleanup in preperation for 2.4.x, make sure all exported functions or variables contain an ap_ prefix. |
d2e300c8f6893b710696db76d2ad32056e729780 711146 |
|
04-Nov-2008 |
niq |
Further unixd hacks to remove duplication between old-unixd and mod_unixd,
and get it working with old MPMS[1] + mod_unixd. It's still an uneasy
split, as some modules (mod_cgid, suexec)[2] also use unixd.
More thinking+hacking due.
[1] Should be prefork/worker/event, but only worker is tested.
[2] cgid is OK, suexec is untested. |
70519fd54cbaeb17f04ef45be265093e9a84b649 709993 |
|
03-Nov-2008 |
niq |
Switch all unix MPMs to use drop_privileges hook (mod_unixd) for startup
and add a flag to prevent running without any module taking responsibility
for managing system privileges! |
3f45498f43b11ef6870ba12d96049b4ac5799fad 668826 |
|
17-Jun-2008 |
gregames |
worker/event MPMs: graceful-stop doesn't work if the listener thread is
waiting for an available worker thread. PR 43081
Reported by: Paul Querna
Debugged by: Takashi Sato [takashi lans-tv.com] |
d6e81217d873dc3b87fc4ffa5fbac2fad4191a15 645455 |
|
07-Apr-2008 |
pquerna |
Remove all references to CORE_PRIVATE. |
978b1ab104c2c8e94e427203eef23ebe63231636 645437 |
|
07-Apr-2008 |
pquerna |
Remove ap_graceful_stop_signalled from all MPMs. |
57b3e48e753a8f5f54714ef41cc1320a24b59e5f 558039 |
|
20-Jul-2007 |
gregames |
the cost of synchronized SMP proof updates far outweighs the value of having
100% accurate MaxRequestsPerChild.
* it doesn't even count requests, it counts connections.
* all it is is a number someone pulls out of a hat in an attempt to deal with
resource leaks.
i.e., no strong need for accuracy.
atomic operations are relatively expensive and this is mainline code. |
5d4512d8c3a70094ff3e941667007a42925f73e2 551843 |
|
29-Jun-2007 |
jorton |
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. |
d9b12166875edee8979f2bd4ad3927e4ed7fdc4b 551835 |
|
29-Jun-2007 |
jorton |
Revert r547987 ("svn merge -c -547987 .") |
a37803b5c687c0bfb99e49bd4b030fb40812774d 547987 |
|
16-Jun-2007 |
jim |
PID table impl: parent process keeps a local table store of
Apache child process PIDs and uses that to check validity
of what's in the scoreboard. |
bb971131c0e68567931ca9e42dfb8010b82d1d0b 490030 |
|
24-Dec-2006 |
trawick |
remove a bit of useless code from worker and event MPMs
PR: 41193
Submitted by: Davi Arnaut <davi haxent.com.br>
Reviewed by: trawick |
96c6da1106276cd58061d4653c2ef2a9f5e8d6bc 483629 |
|
07-Dec-2006 |
rpluem |
* Remove an unused variable and thus fix a compiler warning. |
ae22a04787087f858b9e020716b383705f78407c 465333 |
|
18-Oct-2006 |
chrisd |
added APR_THREAD_FUNC on listener_thread() in event and worker MPMs
to match definition of apr_thread_start_t |
1ce78cf71b5baaf2c1ab48e818cb1f2397df5010 440337 |
|
05-Sep-2006 |
trawick |
Replace ap_get_server_version with ap_get_server_banner() and
ap_get_server_description().
High-level summary:
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.
Third-party modules must now use ap_get_server_banner() or
ap_get_server_description() in place of ap_get_server_version(). |
4bd465052c4a0c8d41e573ee7a90c312d980355f 431460 |
|
15-Aug-2006 |
chrisd |
Introduce a check_config phase between pre_config and open_logs,
to allow modules to review interdependent configuration directive
values and adjust them while messages can still be logged to the
console.
The open_logs phase is already used somewhat for this purpose by
certain MPMs (winnt, prefork, worker, and event) but only by forcing
their functions ahead of the core ap_open_logs() function, and
since this phase runs after the ap_signal_server function during startup,
it can not be used to generate messages on the console when restarting.
Add the check_config phase to mod_info and mod_example.
Handle relevant MPM directives during this phase and format messages
for both the console and the error log, as appropriate. Bounds and sanity
checks on the values of the MPM directives are handled in sequence in
this phase instead of in the various directive handling functions, since
those functions (e.g., set_max_clients()) may not be called at all if their
directives do not appear in the configuration files, and even if they
are called, there is no guarantee that this will occur in any particular
order.
Remove from the worker and event MPMs the code in the pre_config phase
that alters the configuration node tree by re-ordering ThreadsPerChild
ahead of MaxClients. This code is effective but insufficient; for
example, if ServerLimit follows MaxClients, the test against server_limit
in set_max_clients() is invalid. (In practice, this only results in
incorrect or absent warnings on the console, because server_limit is
set to its configured value when the main loop re-runs the configuration
process.)
Prevent ap_threads_per_child from exceeding thread_limit in the
winnt, worker, and event MPMs. This situation could occur if
ThreadsPerChild was not specified in the configuration files and
ThreadLimit was set to a value smaller than DEFAULT_THREADS_PER_CHILD,
because set_threads_per_child() would never be called and therefore
its bounds check against thread_limit would not be performed.
Remove from the winnt, prefork, worker, and event MPMs the
changed_limit_at_restart flag. Set the first_server_limit and
first_thread_limit values during the first execution of the check_config
function, and use them to detect changes to ServerLimit and ThreadLimit
across restarts and issue appropriately formatted warnings. Remove the
comments about the error log being a "bit bucket"; this was true when
the code was originally committed in r92530 but that was due to a bug
fixed in r92769.
Be consistent about setting all MPM configuration directive values in the
pre_config phase.
Rephrase and reformat the console and log file messages relating to
MPM configuration directives to be consistent across all MPMs. Use
briefer messages when logging to the error log than to the console.
Update miscellaneous stale comments and messages (e.g., reference to
daemons_min_free in worker and event MPMs, "prefork open_logs" in
winnt MPM, and StartServers in netware MPM).
The winnt, netware, beos, and mpmt_os2 MPMs should be tested by developers
with access to those platforms, especially the winnt MPM, which has
unique logic with respect to distinguishing between parent and child
processes during the configuration phases.
Update the English documentation for the worker MPM's ThreadsPerChild
directive, which no longer needs to precede other MPM directives in the
configuration files if it has a non-default value. The German (.de) and
Japanese (.ja) translations should be updated by developers fluent in
those languages. |
842ae4bd224140319ae7feec1872b93dfd491143 420983 |
|
11-Jul-2006 |
fielding |
update license header text |
de0d0b50c96fae59c28e09fed61b0d15cfa4147b 409715 |
|
26-May-2006 |
chrisd |
On graceless shutdown or restart, send AP_SIG_GRACEFUL to all worker
threads so that any that are polling on Keep-Alive connections will
wake up and exit promptly. Otherwise, on Linux, they wait until
poll()'s timeout interval completes, which is often too long for
the parent process; the parent issues SIGKILL before the child's main
thread manages to re-join all the worker threads. PR 38737.
On Solaris, by contrast, the close_worker_sockets() function
successfully alerts all worker threads that they should exit quickly.
On Linux, this side-effect of one thread closing another's socket
doesn't occur; see:
http://bugme.osdl.org/show_bug.cgi?id=546
Also, expand on the placeholder in CHANGES regarding previous
cleanups to scoreboard.c and scoreboard.h in r404848 and r404849. |
48fa058fe468025347930610ac2473094fa0f4e4 409693 |
|
26-May-2006 |
chrisd |
Make the worker and event MPMs not touch the scoreboard when
handling a fork() failure. The previous behaviour appears to have
been inherited from the prefork MPM, where is it appropriate.
The prefork MPM sets thread_limit to 1 and therefore each
child process has a single worker_score structure in the scoreboard's
array, i.e., ap_scoreboard_image->servers[slot][0]. In make_child(),
it sets this structure's status to SERVER_STARTING, and then does
a fork(); if the fork() fails, it resets the status to SERVER_DEAD.
The worker and event MPMs, by constrast, obviously use multiple
worker_score structures per child process. They may also be
in use by worker threads from a previous generation at any particular
moment. Therefore make_child() and the parent process in general
doesn't normally update them; make_child() doesn't set them all
to SERVER_STARTING before doing fork(), for example.
So, make_child() shouldn't set them to SERVER_DEAD if fork()
fails (and even if it should, it certainly shouldn't be just
updating the first one). |
2f3824d192aab6fdb059986e0186a59842457e04 404850 |
|
07-May-2006 |
niq |
Initialise server generation (Chris Darroch) |
3ddec0f3e161d5a5afab12c522d92c44e4d7d8fc 399099 |
|
03-May-2006 |
gregames |
PR 39275. don't fork MaxClients worth of processes if child_init or fork() are
slow. |
3d81f57512275ca06a60a9bcbd23c1f8b429fdf2 395228 |
|
19-Apr-2006 |
colm |
Update the copyright year in all .c, .h and .xml files |
048bac5d483fb2fec9488a78fff2afcdba866a93 394116 |
|
14-Apr-2006 |
gregames |
decouple the two scoreboard full messages |
757a7dcefa3934eb09e782be84651803540acd65 393868 |
|
13-Apr-2006 |
gregames |
MaxClients isn't the only reason the scoreboard can fill up. another
reason should be fixed soon.
also add a comment to explain an obscure line of code. |
dace23289120f3af62555d6754d80e9e51d4249e 377291 |
|
13-Feb-2006 |
rooneg |
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. |
e8f95a682820a599fe41b22977010636be5c2717 332306 |
|
10-Nov-2005 |
jim |
No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines |
43c3e6a4b559b76b750c245ee95e2782c15b4296 332305 |
|
10-Nov-2005 |
jim |
No functional change: simple detabbing of indented code. |
bc886ee8559b4feb30d32dc8a50ba2c013c3cc02 307221 |
|
08-Oct-2005 |
trawick |
use Greg's cleaner fix for CAN-2005-2970 |
83d1258656cbb48bbe95da94500f34b607faf05f 292809 |
|
30-Sep-2005 |
trawick |
SECURITY: CAN-2005-2970 (cve.mitre.org)
worker MPM: Fix a memory leak which can occur after an aborted
connection in some limited circumstances. |
28a920f4e4e9deb899e994fdac44ff26e12106d9 265519 |
|
31-Aug-2005 |
colm |
Revert one part. I should have tested seperately. This line isn't neccessary. |
8ee4ebf587d62018a6b8e38b169eb5eec351538d 265518 |
|
31-Aug-2005 |
colm |
Actually allow the admin to set thread_limit higher than the default.
Also, initialise the first_ variables, since they are tested in the
set_ functions. |
efe6f98c76a6c00cd6d88d1e5e8bf9856d699aac 265504 |
|
31-Aug-2005 |
jim |
More getpid format fixes |
b5435778a96719686b741361cd52af2f3ed3f8e8 264104 |
|
29-Aug-2005 |
colm |
*how* did I mis-spell that. |
00a9373468bf0622b0dfa823374a8543eab5df55 264103 |
|
29-Aug-2005 |
colm |
Move the "GracefulShutdownTimeout" command definition into mpm_common |
351155808abca2711c85329ddbe5616a2ef00817 241819 |
|
28-Aug-2005 |
colm |
Implement a graceful-stop for the worker MPM. We close our listeners, and then
ask each child process to do the same. We then monitor until all children have
exited.
The change to ap_start_shutdown(void) to ap_start_shutdown(int) may look like
an external API change, but the function is defined static, and used only in
one place. |
e6a970c1049c5053321d183ffc391de62b17afd7 239740 |
|
24-Aug-2005 |
colm |
Implement "de-listening" in the worker MPM. Fixes PR28167. Comments in CHANGES
file also cover r239710-1. |
a3d53ebd26dd6c3784e64480fba4f20e315e2316 179317 |
|
01-Jun-2005 |
trawick |
downgrade the log level of a proc_mutex_unlock error message
when it occurs during restart; it isn't at all uncommon then
when SysV semaphores are used for the accept mutex
same logic already in place for two other mutex calls |
0e3d261e5d9069a2a4198a4b2e1f1894b493f204 170896 |
|
19-May-2005 |
jorton |
* server/mpm/worker/worker.c (listener_thread): Create ptrans pool as
a child of pconf, to fix APR pool lifetime checks in apr_tables.c.
Submitted by: Joe Schaefer |
d19d0f582dde461e2048a0ade811effb5f6e1524 168649 |
|
06-May-2005 |
gregames |
missed a couple. |
21ef0eb0ade285466e6e5afd62bc59f5ad058c34 168182 |
|
04-May-2005 |
gregames |
worker and event mpms: transient thread creation errors shouldn't take down
the whole server. |
9d2d6520550b46caf38639fcef9f2515399b1c0d 160211 |
|
05-Apr-2005 |
gregames |
the style police have been sleeping |
36c8049de63c446926139936c3d195330a0539ce 156274 |
|
05-Mar-2005 |
trawick |
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. |
08cb74ca432a8c24e39f17dedce527e6a47b8001 151408 |
|
04-Feb-2005 |
jerenkrantz |
Update copyright year to 2005 and standardize on current copyright owner line. |
c169c5f94d61a860f3110c5d29a9fb306e762c11 109510 |
|
02-Dec-2004 |
trawick |
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.) |
af8dee354a287249dd9f3f77bbe850108e5afe43 102975 |
|
16-Mar-2004 |
trawick |
use existing directive name ThreadStackSize instead of
WorkerStackSize
as made obvious by: Brad Nicholes |
14763a0db22322626dd8cd59dfbc3a4fcc655d99 102931 |
|
11-Mar-2004 |
trawick |
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. |
6de8046f8f7e07cd83895a528df25d977e502c76 102619 |
|
09-Feb-2004 |
nd |
fix name of The Apache Software Foundation |
e0c628632cac659dacda1db6d72c99c3c6eb66a1 102587 |
|
08-Feb-2004 |
nd |
fix copyright dates according to the first checkin |
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dc 102525 |
|
06-Feb-2004 |
nd |
apply Apache License, Version 2.0 |
48691c26985721c0d3d386e7880bb65f5c913ad4 102425 |
|
28-Jan-2004 |
trawick |
worker MPM: fix stack overlay bug that could cause the parent
process to crash. |
f881e72fe4f91fd1445c5d81c95f66d6a4a3ee5b 102419 |
|
27-Jan-2004 |
trawick |
Unix MPMs: Stop dropping connections when the file descriptor
is at least FD_SETSIZE.
That isn't a problem for most users (since poll() is widespread).
On old boxes where select() must be used by APR, APR needs to fail
operations that don't work with such fds. |
26a4456dd6f1a5d7d7fff766551461a578687c4a 102135 |
|
01-Jan-2004 |
nd |
update license to 2004. |
3e58434fc65acbe99b4f32e388450dc5db384de5 102047 |
|
13-Dec-2003 |
trawick |
remove inadvertent commit of clumsy gdb workaround (sorry!) |
fc4ba1a0b3b948e6f58105d9736d9241236a6da6 102045 |
|
13-Dec-2003 |
trawick |
update leader, threadpool, and worker MPMs to return MPM state
from ap_mpm_query() |
25c365999eb7e9a0add998ef5d3b64c3c176fec6 101858 |
|
24-Nov-2003 |
brianp |
remove calls to the apr_proc_other_child_read function that no longer exists |
f77e639b38d50d2a798f1b9996b534367db05b58 101801 |
|
17-Nov-2003 |
gstein |
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. |
2d3fb2da7b805e54cb537c698c66e3e92fc022aa 101165 |
|
05-Sep-2003 |
trawick |
Lower the severity of the "listener thread didn't exit" message
to debug, as it is of interest only to developers.
PR: 9011 |
2b534e9b63ce75cf87bbb994bee96479519a152c 101160 |
|
05-Sep-2003 |
trawick |
Fix a misleading message from the some of the threaded MPMs when
MaxClients has to be lowered due to the setting of ServerLimit. |
e4d36aa1eb0631a1b696c7a70d696f9c869bddcc 101122 |
|
28-Aug-2003 |
jwoolley |
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 |
ebd793fbca6d74eb63412bdc974a0af9b972ed8d 101117 |
|
28-Aug-2003 |
bnicholes |
Make sure that the global ap_max_mem_free is initialized along with the
other MPM globals whenever HTTPD is started or restarted. |
a29b6dffea8320685566bcd38a48ce91ef861dee 99312 |
|
09-Apr-2003 |
trawick |
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 |
33bdcae1f7a1a65e351dda2a766a0cf28b1e695d 98573 |
|
03-Feb-2003 |
nd |
finished that boring job:
update license to 2003.
Happy New Year! ;-)) |
922e5bb8adb07eba2a374961787cd489e5c378a7 96558 |
|
28-Aug-2002 |
jim |
Adjust the descriptions of these directives, avoid the child/process/thread
confusion.
PR:
Obtained from:
Submitted by:
Reviewed by: |
58eb8dbbb5aa355342fa21329bb99ab7e82a46c6 96463 |
|
21-Aug-2002 |
jim |
Minor error log typo |
f706ad4ddbeb3b9814f52e83006e505cbb2cf662 96005 |
|
11-Jul-2002 |
rbb |
Bring Apache in line with APR's new poll implementation. This isn't
optimal, because it still uses the compatibility functions to make it
work, but it does work. The next step will be to take the memory for
the pollsets under Apache's control. |
738236127338633bda6136e4715cc1973997b21c 95959 |
|
05-Jul-2002 |
brianp |
replaced APR_USEC_PER_SEC division with the new time macros |
bdbafc44d060509e86f0cc56ff4d19579438f846 95954 |
|
04-Jul-2002 |
striker |
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. |
b26781e595625911fc8fc8215133ad2285ed75d8 95568 |
|
07-Jun-2002 |
jim |
Now that we have the functionality in apr, we can now have 2.0's
startup message regarding AcceptMutex (what we are using and what
the default is) "fully" match what is present in 1.3.
PR:
Obtained from:
Submitted by:
Reviewed by: |
6b28bf6dd38f5c48537960e1c7e97d1fdf0c084b 95373 |
|
30-May-2002 |
striker |
Catch up with the apr_allocator_set_owner -> apr_allocator_owner_set renames
in APR. |
51b1d7f8eaa74807ab14479edde4421e77f5d1d7 95270 |
|
24-May-2002 |
brianp |
Fix for the worker deadlock problem |
9f7325ecad575cf77ab76b01beaaf339a63490b5 95237 |
|
23-May-2002 |
trawick |
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. |
2d399cd7535887fceaa9f8f116eb98ce68ddd602 95149 |
|
17-May-2002 |
trawick |
stop using APLOG_NOERRNO in calls to ap_log_?error() |
421d87f4be8d923b67fcf56c7daae558b2b2b547 94892 |
|
01-May-2002 |
trawick |
wait for worker threads to exit even in graceless termination
(we already have code to make them exit sooner now) |
622b198579318636577fd77c3fb899058c592dfd 94889 |
|
01-May-2002 |
stoddard |
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. |
1e27f530f81c6058d1a11944ae1e2da45977fc7b 94886 |
|
01-May-2002 |
jerenkrantz |
Close sockets on worker MPM when doing a graceless restart. This should
resolve some segfaults see when doing such restarts.
(Justin tweaked the palloc/memset in favor of calloc.)
Submitted by: Aaron Bannert
Reviewed by: Greg Ames, Sander Striker, Justin Erenkrantz |
0a2995e410b3dc0f4ea8da084b3c629e2f771bd0 94840 |
|
29-Apr-2002 |
aaron |
Detect APR_EINTR from ap_queue_pop() and avoid calling
ap_queue_info_set_idle() more than once at a time per worker thread.
This fixes an assert coredump.
Submitted by: Aaron Bannert
Reviewed by: Brian Pane |
5d5d5ca04c57c7ab865924f4648e8f80de27adfe 94830 |
|
28-Apr-2002 |
brianp |
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. |
7d37dff338a52aa8836d78e4f1a67b76911da66c 94824 |
|
28-Apr-2002 |
aaron |
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. |
e3eeefb557413adb03c7a42e86daf7dd223cdbee 94700 |
|
18-Apr-2002 |
trawick |
back out ill-conceived attempt to fix a segfault during
graceless termination |
7d71c6e2d68cacb62dde447387db9212bde85538 94679 |
|
17-Apr-2002 |
trawick |
use an independent pool for threads so that when we abandon them
during graceless termination the cleanups on pchild won't mess with
stuff they are still referencing |
dc10f7a2f87d4cd7cdd16dc248b165122b4ac62b 94625 |
|
12-Apr-2002 |
trawick |
worker MPM: Fix a situation where a child exited without releasing
the accept mutex. Depending on the OS and mutex mechanism this
could result in a hang. |
9d3fdc3bb8077a46851080e17ef9f16c83720c8f 94541 |
|
08-Apr-2002 |
trawick |
Remind the admin about the User and Group directives when we are
unable to set permissions on a semaphore.
PR: 7812 |
3dd9013ade915941216e21c76b183f6fee35face 94443 |
|
05-Apr-2002 |
trawick |
quiet a bogus gcc warning that crops up with -O2 |
0007bb1e01dd762bde7280beb57113309c1715a3 94441 |
|
05-Apr-2002 |
trawick |
worker MPM: add -DFOREGROUND option to use when you want
the parent process to run in the foreground
(NO_DETACH is a special mode for running under
programs like daemontools)
the existing flag -DDEBUG turns on FOREGROUND
now instead of NO_DETACH |
51c0f0fe0a49a180389009442a83f74b1916f96a 94420 |
|
03-Apr-2002 |
trawick |
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. |
7e8bc9ca9d1e752f6ca6debec6be8addae8bd72e 94417 |
|
03-Apr-2002 |
trawick |
Allow worker MPM to build on systems without pthread_kill().
Submitted by: Pier Fumagalli (and mangled by Jeff) |
c5fdaba2e790a0a351d796b5fe3dcfb585be1ba2 94306 |
|
29-Mar-2002 |
jim |
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: |
2fc50921b88defeb7127985dfe4b4130175e069e 94304 |
|
29-Mar-2002 |
jwoolley |
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. |
983988ac7b8faaf037f4df0ab29729cd047a3ffd 94232 |
|
27-Mar-2002 |
trawick |
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 |
9085116d420e1d5f8d7ae7b83fe33a48925ff32b 94117 |
|
22-Mar-2002 |
trawick |
document yet another worker MPM glitch |
bfa7d2f37301e1088e6729a4fec55a9027e6e492 94112 |
|
22-Mar-2002 |
trawick |
remove some unnecessary, commented-out code; add a comment
about a use of signals |
6a5bdbbacf4a62adecde52b8f23ebcc4fa2a08b8 94106 |
|
21-Mar-2002 |
trawick |
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. |
844fabe782230e8b5988545cd6f994b64c1a6e6a 94095 |
|
21-Mar-2002 |
trawick |
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 |
34b6e3b966c6f8ab421309df54a23f1a10cf6f47 94094 |
|
21-Mar-2002 |
trawick |
document a glitch that prevents complete graceful termination of the
process when one of the threads encounters a critical error |
73611bce965336ef42a9ae4c2499bfd76e317dfd 94091 |
|
21-Mar-2002 |
trawick |
make the comment for the call to apr_signal_thread() a little more
correct about what it is going to do |
be88f2abf4b709736dec9e39f9e882a056b6e1ec 94068 |
|
21-Mar-2002 |
trawick |
don't log a failure of ap_queue_pop() at termination; it is
expected |
a3bfb71779764e2ff08d4061815cf3a50d8770ce 94067 |
|
21-Mar-2002 |
trawick |
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 |
836d6aa72d33f9bfc8e277577824d4103fc10173 94062 |
|
20-Mar-2002 |
jim |
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: |
eb37bbfcbc8e8571a8b8434a8c3fff02cf3d590d 94061 |
|
20-Mar-2002 |
trawick |
no need to kill the scoreboard cleanup anymore on graceful
restart; the scoreboard is longer-lived
PR:
Obtained from:
Submitted by:
Reviewed by: |
200cb28cb4e4824735bb955c2be9b066bc56da0d 94059 |
|
20-Mar-2002 |
trawick |
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 |
b4e4d76bf454e1b603b410110356dbcf12f3bc42 94055 |
|
20-Mar-2002 |
jim |
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: |
de379472efa6c1f8b8e9cafbd8997f3c6a3ee00a 94039 |
|
20-Mar-2002 |
wrowe |
The pre_mpm hook creates server-lifetime objects (or at least, for the
generations across graceful restarts.) They should use the process pool. |
54143bdfb311afb61cf41a56713c051ca752c17d 94031 |
|
20-Mar-2002 |
trawick |
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: |
52ec14eddd6ee9e372a1925e457b66681636763e 94030 |
|
20-Mar-2002 |
trawick |
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 |
1b9d817117f2d560337c5f44cfd78d812cad92a5 94025 |
|
19-Mar-2002 |
trawick |
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 |
e0b7b4e471cc170b7119ac8513b58aac25a29a76 94024 |
|
19-Mar-2002 |
trawick |
"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 |
cd33e904721c940f3bc632fca099fb00b87567ed 94017 |
|
19-Mar-2002 |
trawick |
get rid of unnecessary code to track the number of worker threads |
eee7af969027d291b3dde43bffa32ad5ec19a277 93998 |
|
18-Mar-2002 |
trawick |
prefork and worker:
after allocating a new scoreboard, make sure the right generation
is stored in the global score |
cb97ae2ff6969c2789b8e03f1bc4187fa73b6baf 93969 |
|
16-Mar-2002 |
wrowe |
Simplify s/APR_OS_PROC_T_FMT/APR_PID_T_FMT/, apr_os_foo entities aren't
for external consumption. |
a462faa9b49ab5afbba870be13594ab2457fa54a 93943 |
|
15-Mar-2002 |
striker |
Update the mpms to call the new allocator/pools API |
bc8fd1b0b1afdf89b8d28eefa8cd74e26ba97986 93918 |
|
13-Mar-2002 |
fielding |
Update our copyright for this year. |
bcf4e07545151b09db0f528e3312b6c913857f1a 93720 |
|
05-Mar-2002 |
trawick |
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 |
8a33397ee2ddb98496647b5cf83393cdf847d301 93719 |
|
05-Mar-2002 |
trawick |
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 |
5e9fd4fd7acbe7bee098b898dc6d7c6480d79904 93718 |
|
05-Mar-2002 |
trawick |
skip the lock release if the lock obtain failed |
2155dceaf6d347ebf2178f43a33891b69c6f6900 93561 |
|
24-Feb-2002 |
trawick |
restart fixes for worker:
fix a segfault and a window in which we could miss joining
newly-created threads
we can't try to signal workers if the worker queue hasn't
been initialized (or we segfault)
make sure the start thread is done creating threads before
we try to join; otherwise we can just miss some of them and
not be able to clean them up properly |
e05cb4bd721e35ac27a7064d0bb9d7a626327751 93535 |
|
21-Feb-2002 |
aaron |
Implement apr_proc_detach changes and allow -DNO_DETACH in the multi-process
mode to not "daemonize" while detaching from the controlling terminal.
This is necessary for Apache to work with process-management tools like
AIX's "System Resource Controller" as well as Dan Bernstein's "daemontools".
What this means is apache must _NOT_ be a process group leader if called
with the -DNO_DETACH flag.
Submitted from: Jos Backus <josb@cncdsl.com>
Edited/Reviewed by: Aaron Bannert |
a322a82f79b790fb7ddcd7df4459d20725450fa7 93530 |
|
21-Feb-2002 |
trawick |
Convert the ap_queue_foo routines to return apr_status_t as appropriate. |
1a5657cc931769677d71912d29fab36753988195 93528 |
|
21-Feb-2002 |
trawick |
zap an incorrect comment |
2f1be60b7ec2d3bbb5515d34754ba5cfe65fdef7 93434 |
|
15-Feb-2002 |
aaron |
Implement new ScoreBoardFile directive logic. This affects how we
create the scoreboard's shared memory segment. We now have the best of
both worlds:
if config specifies ScoreBoardFile
create name-based shared memory, errors are fatal
else /* we get to choose */
create anonymous shared memory
if ENOTIMPL
create name-based shared memory from DEFAULT_SCOREBOARD
else
errors are fatal
This gives us the flexibility to have anonymous shared memory (on platforms
that support it) as well as name-based shared memory when third-party
programs want access to our scoreboard.
The ap_scoreboard_fname static variable is now owned by the scoreboard.c
file, and no longer by the MPMs. The MPMs MUST NOT set ap_scoreboard_fname
to a default, since that will override the default creation logic and
only allow name-based segments.
Submitted by: Aaron Bannert
Reviewed by: Justin Erenkrantz |
ff9692e80466d6d47ec2f5773b5f028ab82838bc 93403 |
|
14-Feb-2002 |
aaron |
Retain signal handling in the worker MPM for the one_process case
(httpd with -DDEBUG, -X, or -DONE_PROCESS).
Fix -X, -DNO_DETACH, -DONE_PROCESS, etc. flags.
Tested on solaris w/ start/stop, restart, graceful, and with the
above debugging flags. |
3264438575d967c19e5fab7f18f9487a1e4860b5 93386 |
|
13-Feb-2002 |
brianp |
Performance optimization: updated the worker MPM to recycle
per-transaction pools instead of destroying them. Based on
Ian's benchmark testing, this reduces CPU utilization by
about 1% on Solaris. |
6d74c65f131583f6832b04424c1a9e1e7cc72c8e 93366 |
|
12-Feb-2002 |
gregames |
if a child detects a resource shortage on accept(), limit the rate of fork()s
to 1 per second until the situation clears up.
Inspired by: Martin Kraemer |
ae513479ef15ec9f76aa7b0ecb618ecfcdeb211c 93358 |
|
11-Feb-2002 |
rbb |
Remove all signal handling from the worker MPM's child processes. Instead,
we use the pipe of death for all communication between parent and child. |
aeb0d3671f04e66201c6b08a26ddc69f879029c8 93264 |
|
06-Feb-2002 |
wrowe |
Some compatibility fixes. Built yet untested, read three times through.
Please review and raise the flag if any of these introduce bad mojo. |
af262486b3d1c33299307195a715bd1e373f99af 93227 |
|
04-Feb-2002 |
rbb |
Not being able to bind to a socket is a fatal error. This makes all
MPMs treat it as such. We now print a message to the console, and return
a non-zero status code. |
19a01f46d8da4d6e80ddd54c99d50e3bce5217cb 93171 |
|
01-Feb-2002 |
stoddard |
Reintroduce the create_connection hook. This hook is required to enable
modules to completely take over all network i/o from the core. |
169be500e5f4a70c6f299888f37f348803811b07 93119 |
|
30-Jan-2002 |
rbb |
Change the Windows MPM to only use the pre_mpm phase in the parent process.
The child processes use the child_init phase to reattach to the shared
memory. This makes Windows work like Unix, which should make it easier
for module authors to write portable modules. |
7f8ce2b12970c82a2da49fca821d163ae3151f44 93101 |
|
30-Jan-2002 |
trawick |
get rid of a bunch of warnings about unused variables |
9b0141308bc27f61d82742c198356975aa6b488a 93096 |
|
30-Jan-2002 |
brianp |
Added logic to the worker MPM to skip the poll before accept
if there's only one listener socket (based on the implementation
in the prefork MPM). This also enables us to do single-listener
unserialized accept |
4fbb89a070c82e489830233bde6bc78ddf179978 93087 |
|
29-Jan-2002 |
stoddard |
This patch restores most of Ryan's patch (11/12/2001) to remove the
client_socket from the conn_rec. Diffs from Ryan's patch include:
- rename the create_connection hook to install_transport_filters
- move the point of invocation of the hook till after the call to
after ap_update_vhost_given_ip to enable the hook to use vhost
config info in its decision making. |
ae695b6a7316a92dddee9327ce71ec65ba522670 93069 |
|
29-Jan-2002 |
aaron |
Take advantage of the new pre_config return value when apr_proc_detach
fails. I'll be making some changes to apr_proc_detach, and it will be
nice to be able to report runtime errors.
Tested on worker but the code changes are identical on other MPMs. |
417f504d4d11631c0d062be85347f82a26c88677 93063 |
|
29-Jan-2002 |
aaron |
The pre_config hook now takes a return value. This allows modules to
cause the server to bail out under error conditions. |
efe580fe4c6188dd6a4fa769f6a96e86b28692b1 93057 |
|
28-Jan-2002 |
trawick |
zap an unintended (and incorrect) comment that slipped in with
the last commit; sorry! |
7a95e47ff0d0e4306df0901d56131b49dca5691e 93055 |
|
28-Jan-2002 |
trawick |
fix the problem where a scoreboard init failure could leave
mod_cgid stranded
a pre_mpm hook can now return failures, so problems in
ap_create_scoreboard percolate back to a place where Apache
can exit cleanly |
b393bdb2e1eabbe4b9b37c5eaeeeca799b2eb324 93050 |
|
27-Jan-2002 |
stoddard |
Remove the create_connection hook and put the client_socket back into the
conn_rec. The create_connection_hook has a design flaw that prevents it
from making decisions based on vhost information. |
7ef3a1797818c6d25efe8c5fadb5eec3b965a6fa 92821 |
|
11-Jan-2002 |
brianp |
Fix for a segfault in the worker MPM during graceful shutdown:
The per-transaction pools in the worker MPM can't be children of
the listener thread's pool, because that pool may go out of scope
while some workers are still procesing requests using the transaction
pools. |
26dfa083a1662d57ba7cc410eec4e0696b9be469 92791 |
|
10-Jan-2002 |
wrowe |
This patch eliminated from the _SHARED_ segment of the scoreboard all
pointer math. This is required for portable scoreboards.
vhost becomes the 'vhost name string' so it now survives ap_generation
clicks. next was apparently never used.
This patch also accounts for the changes to the apr_shm api, and gives
Win32 the magic of a shared scoreboard.
Breakage aplenty on non-win32 platforms, I suspect, but this radical
surgery, and culling of unused functions, was really, really needed. |
612b906e8dd17ebb1704b6663caf5d9ab321f971 92653 |
|
30-Dec-2001 |
trawick |
handle the disappearance of apr_lock_create_np() and
apr_proc_mutex_create_np() and the new parameter to
apr_lock_create() and apr_proc_mutex_create() |
4fdf6f42241ea2497da9919ac56e30e598003059 92648 |
|
29-Dec-2001 |
wrowe |
mpm_common.c did all this dirty work - cleans up a duplicate symbol error
from the OSX.1 build. |
797a1d756d04cfd210d3b7664ae150e552c2aa13 92632 |
|
28-Dec-2001 |
aaron |
Clean up the error checking a little. Make sure we're comparing against
APR_SUCCESS instead of just non-zero. Add some new error checking/reporting. |
511a34f3f9012d4e020af35a56fae5fcf7dfbf74 92622 |
|
27-Dec-2001 |
aaron |
Take advantage of the new usable apr_thread_exit(). |
27757f6699a924d4b493a1b6cceb27df27a43287 92598 |
|
25-Dec-2001 |
dreid |
Add ap_os_killpg as well as unixd_killpg and beosd_killpg.
Move the worker MPM to use ap_os_killpg in place of unixd_killpg as
this makes it more portable.
Ryan notes that really we should be using the POD mechanism to
control death of the child processes, so this is temporary until
we have that change in place. Note added to STATUS to that effect. |
89bae5fb024b7b26e5a505775ef91bc4aec7dfeb 92597 |
|
25-Dec-2001 |
dreid |
unixd.h is included in mpm.h so shouldn't need to be included here as well. |
ecaf69116d1f50265f0e3a14e67bac20c561e0cb 92596 |
|
25-Dec-2001 |
dreid |
This allows platforms without the _NP locking palaver to build
the worker MPM. |
21a18028125871eacf7ada137075a654ea80310c 92581 |
|
23-Dec-2001 |
dreid |
This fixes a segfault that showed up on BeOS and may catch other systems. |
1eb1f02a23de724c105b2c6c9fbd469a611059c6 92530 |
|
19-Dec-2001 |
trawick |
Add directives to worker and preform MPMs so that the admin can set
the equivalent of HARD_SERVER_LIMIT/HARD_THREAD_LIMIT at startup. |
3f7e64b7de2f54e907e6a4f32a7efb0721f3d8b8 92521 |
|
18-Dec-2001 |
trawick |
leaving the pipe-of-death in the ap_listeners list led to segfaults
during sighup processing since the pipe-of-death listen_rec was
allocated from a short-lived pool
simply allocating the pipe-of-death listen_rec from the right pool
isn't a complete fix since at that point we no longer get the
proper cleanup and we're left with a file descriptor leak
the simplest overall fix seems to be to keep the pipe-of-death out
of the ap_listeners list for now |
ca47a2b6bcea23e8af185c68f256dcbbfd2a0f9d 92512 |
|
18-Dec-2001 |
trawick |
Change core code to allow an MPM to set hard thread/server
limits at startup. |
a3bb95a3600153c7f09f62749e32093658943c32 92482 |
|
14-Dec-2001 |
brianp |
Use the new APR pool code to reduce pool-related lock
contention in the worker MPM.
Submitted by: Sander Striker
Reviewed by: Brian Pane |
3b8330d384f3fe7fcfd2891f0885e080e8390495 92473 |
|
14-Dec-2001 |
jerenkrantz |
Style change. Convert tabs->spaces, shorten long lines, etc, etc, etc. |
23d8f62856c1531526042e1c5edf44557cadd2e5 92412 |
|
10-Dec-2001 |
trawick |
get worker MPM to respect the LockFile setting |
705c8ed3ef608706c91ca12483d7b54ff9007cc9 92387 |
|
08-Dec-2001 |
jerenkrantz |
Fix segfault when restarting worker MPM. We can not examine the POD as
a normal listener.
There was an additional bug than what Ian submitted to fix listen.c
(i.e. check sa for null): make_pipe_of_death does not zero out
lr->bind_addr (since it uses apr_palloc). So, on Solaris, the first
time through, bind_addr was probably 0, but the second time, not (pools!).
(This caused Aaron's analysis that the patch worked the first time,
but not the second time.)
Submitted by: Ian Holsman
Reviewed by: Justin Erenkrantz, Aaron Bannert |
9ca934cec0a1cc3c425fde5dc51956bce6cd3183 92130 |
|
22-Nov-2001 |
brianp |
fix segv in worker MPM following check_pipe_of_death() call |
5ad238c42b1e159ee8f164515e0c4ee6c727c2fd 92019 |
|
17-Nov-2001 |
trawick |
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. |
d7d24786c80ad1ae337b916a0a44b2a7b8fcb54d 91968 |
|
15-Nov-2001 |
rbb |
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. |
1e0888f1d382ad164bffe895152cd4f4af213dff 91960 |
|
15-Nov-2001 |
rbb |
Get rid of the listensocks array. It was just duplicating the ap_listeners
list. No reason to have the same information stored twice. |
9a91b81a2ed88650b2cad612b30dd53720bc2a09 91955 |
|
15-Nov-2001 |
rbb |
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. |
cc5e9d68a9cbb9fe844aed4b2f815eb09050d06f 91913 |
|
13-Nov-2001 |
rbb |
Add the server_rec argument back to the create_connection hook.
Submitted by: Greg Stein |
1c0b7c3bdace07946457fa7ba04b7f97b6599792 91896 |
|
13-Nov-2001 |
rbb |
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 |
57dbb41e7cf44cdd9aa99aa4c065e769463ab6b1 91889 |
|
13-Nov-2001 |
rbb |
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. |
e6cc28a5eb3371ba0c38e941855e71ff0054f50e 91887 |
|
13-Nov-2001 |
rbb |
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. |
ae64f3e7385f21ca9d4f30cc7f8702a9ac1034b6 91880 |
|
12-Nov-2001 |
trawick |
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. |
53509ebdb0660b47696e64b8214b73818d339553 91832 |
|
10-Nov-2001 |
rbb |
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. |
c4fbc4018fd2b6716673a38ee27eeb36cba41c5d 91777 |
|
07-Nov-2001 |
jwoolley |
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. |
022cff78006f698453640e0a0e97cc5f8c9de59d 91648 |
|
23-Oct-2001 |
rbb |
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 |
ae8c25f1fb85da648b2b428430a4ed2046b2b6dd 91582 |
|
20-Oct-2001 |
aaron |
Missed some error messages in the switch to the new lock system. Added
the proc_mutex header for the sake of consistency. |
9cbd9bca8fa9cfa2bc93f797937e8b7e1cdf076b 91580 |
|
20-Oct-2001 |
aaron |
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? |
702b9917f2bd441b2d8ab8aa34f28c46bc4d795c 91518 |
|
17-Oct-2001 |
aaron |
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. |
9d41fafe32b324c197f25224207fc6ce34f085bf 91122 |
|
24-Sep-2001 |
rbb |
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> |
055a81cd48bc6a2e4382e2b64613d20c77f02015 91089 |
|
19-Sep-2001 |
trawick |
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 |
2d88561eba52512a98f9f3e8721decd6233ae2bf 91082 |
|
19-Sep-2001 |
jwoolley |
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. |
cdb15137887e284797e9510029098dc725b4dacf 91079 |
|
19-Sep-2001 |
jerenkrantz |
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 |
0aa8e8fd5a242948518655f2296b3c76386754e5 91076 |
|
19-Sep-2001 |
jerenkrantz |
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. |
de3abad1fe263e577bb11e99b358836bd901397c 91075 |
|
18-Sep-2001 |
rbb |
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> |
d6a93816bfaa5b3de5f2e6cb0d172cbe20dd056e 90824 |
|
30-Aug-2001 |
jerenkrantz |
Add -X functionality back to httpd.
- Updates upgrading.html
- Reverts Aaron's earlier docco patch (sorry...)
- Adds -X to all mpms in the tree |
c26b079f6995cd8fb30c68d2e17b69b2f91ac700 90790 |
|
30-Aug-2001 |
jwoolley |
Update the comments regarding -DONE_PROCESS and -DNO_DETACH since
-X doesn't exist anymore.
Submitted by: Aaron Bannert |
539f01c601dbdfec656fa4b258703b67d336e5b6 90788 |
|
30-Aug-2001 |
rbb |
Remove the declarations for variables that were moved into the core. |
47697533fd7ced2259f9150677ea5efa583b6c13 90771 |
|
28-Aug-2001 |
rbb |
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> |
2eb293852c51915c494e66282ba79ecd209efde1 90673 |
|
26-Aug-2001 |
dougm |
didt pay attention to the first question; pretty sure answer is no |
a6032fc0482fb26a635f3bac5e06e1a53f830b8e 90670 |
|
26-Aug-2001 |
dougm |
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: |
e00ae6859667e293a4c40108f524408ae1289f2f 90635 |
|
24-Aug-2001 |
rbb |
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>] |
7ba58e7e63da9a8b84f6160c476a0c9d639c81e9 90213 |
|
16-Aug-2001 |
trawick |
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 |
00b8146bf5d1f543ce19917c6b4fe252d33baf79 90153 |
|
14-Aug-2001 |
trawick |
namespace-protect accept_lock_mech
fix a bug in the worker MPM which effectively disabled the AcceptMutex
directive |
7b4c4bb891261e613de39a021d7554fd08132fc5 90132 |
|
13-Aug-2001 |
rbb |
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> |
12348d5b520522b6581d907ef9c1ceda029fbc05 90065 |
|
10-Aug-2001 |
rbb |
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. |
f4434a8c7b59509850470dfc3ebe2b79c9548649 90064 |
|
10-Aug-2001 |
gregames |
record something in the error log if the parent process seg faults
Submitted by: Jeff Trawick |
642143c4942ddbc525b224720eaa2ef5d465fa1e 89938 |
|
06-Aug-2001 |
rbb |
Explain the worker MPM |
39ec0caa195570eff38f6c2b0d022e7f45d56310 89930 |
|
05-Aug-2001 |
rbb |
Get the worker MPM working again. This should fix the serialization
problems, and it makes up initialize the queue only once. |
af2bf35f47aaa3f1a3b1fe8336b9d20efad5b7e9 89928 |
|
05-Aug-2001 |
gregames |
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. |
a8f479c6b0803442f0c24cf62444222c26e26d1d 89921 |
|
04-Aug-2001 |
trawick |
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 |
3b94c4e48459931cd479241d7844efc525773bb7 89881 |
|
02-Aug-2001 |
gregames |
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. |
db68a93b6f008d48ce1c50ab59e153969ea5dbcf 89827 |
|
31-Jul-2001 |
rbb |
It helps if we broadcast to the workers that we are trying to shutdown. |
f8b7801ea5717ef22cc0d02bffacfd5f9e48f898 89821 |
|
31-Jul-2001 |
gregames |
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. |
190565e4d97b8b2a4ca8cc26a17c5fc64e54eb5f 89817 |
|
31-Jul-2001 |
gregames |
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. |
b1627fe7e2cb3809dcdfdf1fcbbb6dbccaf788c6 89781 |
|
30-Jul-2001 |
rbb |
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. |