1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-11 02:42:23 +03:00
Commit Graph

249 Commits

Author SHA1 Message Date
Christophe Jaillet
08b6d16ffc 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.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1433682 13f79535-47bb-0310-9956-ffa450edef68
2013-01-15 21:53:07 +00:00
Jim Jagielski
1d0042a397 missed one
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1410004 13f79535-47bb-0310-9956-ffa450edef68
2012-11-15 20:57:23 +00:00
Jim Jagielski
3452941de8 no longer needed
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1409273 13f79535-47bb-0310-9956-ffa450edef68
2012-11-14 17:45:42 +00:00
Jim Jagielski
a24b85145b 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1409214 13f79535-47bb-0310-9956-ffa450edef68
2012-11-14 14:26:26 +00:00
Jeff Trawick
4f5b52d406 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1364601 13f79535-47bb-0310-9956-ffa450edef68
2012-07-23 12:15:39 +00:00
Jeff Trawick
932dec80a8 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1363557 13f79535-47bb-0310-9956-ffa450edef68
2012-07-19 21:31:52 +00:00
Jeff Trawick
7b1e88d285 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1363440 13f79535-47bb-0310-9956-ffa450edef68
2012-07-19 17:54:13 +00:00
Stefan Fritsch
92e366007c Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +00:00
Jeff Trawick
00b4adb3b1 revert accidental commit 1200129
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200140 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 04:19:21 +00:00
Jeff Trawick
e4f5c7198e 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)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200129 13f79535-47bb-0310-9956-ffa450edef68
2011-11-10 04:10:42 +00:00
Stefan Fritsch
7d0348cd78 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>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1180742 13f79535-47bb-0310-9956-ffa450edef68
2011-10-09 23:10:12 +00:00
Jim Jagielski
427c85bd23 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +00:00
Stefan Fritsch
01ed21af9d 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1172686 13f79535-47bb-0310-9956-ffa450edef68
2011-09-19 16:25:42 +00:00
Stefan Fritsch
d4e7fad995 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1151234 13f79535-47bb-0310-9956-ffa450edef68
2011-07-26 20:37:49 +00:00
Stefan Fritsch
344dbd4e82 Reduce period during startup and restart where a successive signal may be lost
PR: 43696
Submitted by: Arun Bhalla <arun shme net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1151233 13f79535-47bb-0310-9956-ffa450edef68
2011-07-26 20:36:56 +00:00
Stefan Fritsch
4b3f0aaf96 Log the deprecation warning at level info, not warn
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1137813 13f79535-47bb-0310-9956-ffa450edef68
2011-06-20 22:57:24 +00:00
Stefan Fritsch
5f2cf595f0 Fix search'n'replace error: Actually warn if MaxClients is used
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1137757 13f79535-47bb-0310-9956-ffa450edef68
2011-06-20 19:47:23 +00:00
Stefan Fritsch
6d8de2ff42 Rename MaxClients to MaxRequestWorkers which describes more accurately what
it does.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1137744 13f79535-47bb-0310-9956-ffa450edef68
2011-06-20 19:00:52 +00:00
Jeff Trawick
462c69e0b5 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1096609 13f79535-47bb-0310-9956-ffa450edef68
2011-04-25 21:21:22 +00:00
Jeff Trawick
3c0476fe50 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1087085 13f79535-47bb-0310-9956-ffa450edef68
2011-03-30 21:32:10 +00:00
Jeff Trawick
5e3ba7d3ee 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)


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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086224 13f79535-47bb-0310-9956-ffa450edef68
2011-03-28 13:35:08 +00:00
Joe Orton
239188a96b * 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1084000 13f79535-47bb-0310-9956-ffa450edef68
2011-03-21 22:36:45 +00:00
Jeff Trawick
4487fa925a 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1078286 13f79535-47bb-0310-9956-ffa450edef68
2011-03-05 13:36:09 +00:00
Jeff Trawick
21a628f138 zap needless reinitialization of is_graceful on the 2nd
call of the open-logs hook


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1078285 13f79535-47bb-0310-9956-ffa450edef68
2011-03-05 13:09:12 +00:00
Jeff Trawick
3b75c26516 sanity check use of volatile in prefork, worker, and event
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1078170 13f79535-47bb-0310-9956-ffa450edef68
2011-03-04 22:12:21 +00:00
Jeff Trawick
b7a8638aca worker: child_main() never returns, so remove some dead code after
one of the calls


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1076614 13f79535-47bb-0310-9956-ffa450edef68
2011-03-03 13:16:14 +00:00
Stefan Fritsch
5bcd082e3d Rename MaxRequestsPerChild to MaxConnectionsPerChild, which
describes more accurately what the directive does.

The old name still works but logs a warning.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1021924 13f79535-47bb-0310-9956-ffa450edef68
2010-10-12 21:12:37 +00:00
Stefan Fritsch
ebb62867fb Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
Rainer Jung
6c696580ea Silence compiler warning.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951866 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 14:04:06 +00:00
Jeff Trawick
007951df35 fix compile failure in r940981
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@941454 13f79535-47bb-0310-9956-ffa450edef68
2010-05-05 20:01:22 +00:00
William A. Rowe Jr
01d300298f Catch up with ap_[proc|global]_mutex_create api change
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@940981 13f79535-47bb-0310-9956-ffa450edef68
2010-05-04 17:40:43 +00:00
Eric Covener
555372fbfc all signs indicate that status value is always -1 on error
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@922405 13f79535-47bb-0310-9956-ffa450edef68
2010-03-12 19:55:35 +00:00
Eric Covener
c81cbf5592 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.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@922392 13f79535-47bb-0310-9956-ffa450edef68
2010-03-12 18:49:26 +00:00
Daniel Earl Poirier
0c96068dc4 Log command line on startup, so there's a record of command line
arguments like -f.  Suggested by Shaya Potter.  [Dan Poirier]
PR: 48752


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@910684 13f79535-47bb-0310-9956-ffa450edef68
2010-02-16 20:50:10 +00:00
Jeff Trawick
aecc198b93 change the preprocessor define ap_accept_mutex_type to upper case
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@907723 13f79535-47bb-0310-9956-ffa450edef68
2010-02-08 16:59:45 +00:00
Daniel Earl Poirier
16b9ccd6ec worker: don't report server has reached MaxClients until it does.
Add warning when within MinSpareThreads.

PR: 46996


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@906535 13f79535-47bb-0310-9956-ffa450edef68
2010-02-04 16:00:51 +00:00
Takashi Sato
b4e16bedea string constness
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@894361 13f79535-47bb-0310-9956-ffa450edef68
2009-12-29 11:51:40 +00:00
Jeff Trawick
2e9668a33d 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@883540 13f79535-47bb-0310-9956-ffa450edef68
2009-11-23 23:17:51 +00:00
Jim Jagielski
83532ab628 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@818825 13f79535-47bb-0310-9956-ffa450edef68
2009-09-25 11:59:30 +00:00
Greg Ames
201d3d584f * 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@815915 13f79535-47bb-0310-9956-ffa450edef68
2009-09-16 18:07:09 +00:00
Ruediger Pluem
3fadc493c9 * Do better checking of pollset operations in various places to avoid segfaults.
PR: 46467
Submitted by: Stefan Fritsch <sf sfritsch.de>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@804764 13f79535-47bb-0310-9956-ffa450edef68
2009-08-16 20:29:47 +00:00
Greg Ames
f9554d542d 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...



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@765305 13f79535-47bb-0310-9956-ffa450edef68
2009-04-15 18:52:39 +00:00
Jeff Trawick
d1c3416282 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@762127 13f79535-47bb-0310-9956-ffa450edef68
2009-04-05 17:54:22 +00:00
Jeff Trawick
23ac01a833 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@760864 13f79535-47bb-0310-9956-ffa450edef68
2009-04-01 11:53:50 +00:00
Jeff Trawick
fb6a306876 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759924 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 11:27:53 +00:00
Jeff Trawick
35e3599b25 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759757 13f79535-47bb-0310-9956-ffa450edef68
2009-03-29 19:30:17 +00:00
Jeff Trawick
a1908585a8 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759699 13f79535-47bb-0310-9956-ffa450edef68
2009-03-29 14:41:02 +00:00
Mladen Turk
bf086f6dcc Register rewrite_args hook.
Now, dunno if that was intended, but at least allow to start the httpd

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759648 13f79535-47bb-0310-9956-ffa450edef68
2009-03-29 08:22:28 +00:00
Jeff Trawick
901744828a prefork, worker, event:
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
2009-03-26 15:24:11 +00:00