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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1433682 13f79535-47bb-0310-9956-ffa450edef68
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
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1364601 13f79535-47bb-0310-9956-ffa450edef68
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1363557 13f79535-47bb-0310-9956-ffa450edef68
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1363440 13f79535-47bb-0310-9956-ffa450edef68
(presence is odd, since this variable as an API was supposedly removed
long ago, and a similarly named static variable was removed in r1078286)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200129 13f79535-47bb-0310-9956-ffa450edef68
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1172686 13f79535-47bb-0310-9956-ffa450edef68
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1096609 13f79535-47bb-0310-9956-ffa450edef68
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1087085 13f79535-47bb-0310-9956-ffa450edef68
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)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086293 13f79535-47bb-0310-9956-ffa450edef68
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1084000 13f79535-47bb-0310-9956-ffa450edef68
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1078286 13f79535-47bb-0310-9956-ffa450edef68
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@922392 13f79535-47bb-0310-9956-ffa450edef68
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@883540 13f79535-47bb-0310-9956-ffa450edef68
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.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@815915 13f79535-47bb-0310-9956-ffa450edef68
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...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@765305 13f79535-47bb-0310-9956-ffa450edef68
. 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
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@760864 13f79535-47bb-0310-9956-ffa450edef68
restore expected accept mutex mechanism and allocator limit support
(the related AP_MPM_WANT_foo defines no longer exist)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758680 13f79535-47bb-0310-9956-ffa450edef68