1
0
mirror of https://github.com/apache/httpd.git synced 2025-09-15 09:21:11 +03:00

95 Commits

Author SHA1 Message Date
Yann Ylavic
a870a54130 mpm_event,worker}: Really perform_idle_server_maintenance() per bucket.
mpm_{event,worker}: No need to pass num_buckets to perform_idle_server_maintenance() and server_main_loop().

mpm_worker: the last used scoreboard slot depends on pid != 0 only.

Align max_daemons_limit value on all MPMs.

That's the number of scoreboard slots in use, so it shouldn't be negative.
Fix off by one in OS/2 too.

Submitted by: ylavic <ylavic.dev@gmail.com>

Github: closes #274


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894291 13f79535-47bb-0310-9956-ffa450edef68
2021-10-15 13:22:11 +00:00
Yann Ylavic
f461bcf12c Add missing pool tags to help debugging.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876599 13f79535-47bb-0310-9956-ffa450edef68
2020-04-16 12:32:33 +00:00
Mike Rumph
85760859ca Fix spelling errors found by codespell. [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1873985 13f79535-47bb-0310-9956-ffa450edef68
2020-02-13 18:15:57 +00:00
Yann Ylavic
10c930ddcb event, worker: runtime pool.
MPMs event and worker both need a dedicated pool to handle the creation of
the threads (listener, workers) and synchronization objects (queues, pollset,
mutexes...) in the start_threads() thread, with at least the lifetime of
the connections they handle, and thus survive pchild destruction (notably
in ONE_PROCCESS mode, but SIG_UNGRACEFUL is concerned too).

For instance, without this fix, the below backtrace can happen in ONE_PROCCESS
mode and a signal/^C is received (with active connections):

Thread 1 "httpd" received signal SIGSEGV, Segmentation fault.
(gdb) bt
#0  <BOOM>
#1  0x00007ffff7c7e016 in apr_file_write (thefile=0x0, ...)
                                          ^ NULL (cleared)
                       at file_io/unix/readwrite.c:230
#2  0x00007ffff7c7e4a7 in apr_file_putc (ch=1 '\001', thefile=0x0)
                                                      ^ NULL (cleared)
                       at file_io/unix/readwrite.c:377
#3  0x00007ffff7c8da4a in apr_pollset_wakeup (pollset=0x55555568b870)
                                              ^ already destroyed by pchild
                       at poll/unix/pollset.c:224
#4  0x00007ffff7fc16c7 in decrement_connection_count (cs_=0x7fff08000ea0)
                       at event.c:811
#5  0x00007ffff7c83e15 in run_cleanups (cref=0x7fffe4002b78)
                       at memory/unix/apr_pools.c:2672
#6  0x00007ffff7c82c2f in apr_pool_destroy (pool=0x7fffe4002b58)
                                            ^ master_conn
                       at memory/unix/apr_pools.c:1007
#7  0x00007ffff7c82c12 in apr_pool_destroy (pool=0x7fff08000c28)
                                            ^ ptrans
                       at memory/unix/apr_pools.c:1004
#8  0x00007ffff7c82c12 in apr_pool_destroy (pool=0x555555638698)
                                            ^ pconf
                       at memory/unix/apr_pools.c:1004
#9  0x00007ffff7c82c12 in apr_pool_destroy (pool=0x555555636688)
                                            ^ pglobal
                       at memory/unix/apr_pools.c:1004
#10 0x00005555555f4709 in ap_terminate ()
                       at unixd.c:522
#11 0x00007ffff6dbc8f1 in __run_exit_handlers (...)
                       at exit.c:108
#12 0x00007ffff6dbc9ea in __GI_exit (status=<optimized out>)
                       at exit.c:139
#13 0x00007ffff7fc1616 in clean_child_exit (code=0)
                       at event.c:774
                                  ^ pchild already destroyed here
#14 0x00007ffff7fc5ae4 in child_main (child_num_arg=0, child_bucket=0)
                       at event.c:2869
...


While at it, add comments about the lifetimes of MPMs pools and their objects,
and give each pool a tag (e.g. "pchild" accordingly to other MPMs).

(follow up for event_pollset in r1835846).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1835845 13f79535-47bb-0310-9956-ffa450edef68
2018-07-13 15:02:03 +00:00
Yann Ylavic
9ed858cd50 mpms: follow up to r1629925: more error reports.
Failing to setup (or no) listeners is also an error.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1733173 13f79535-47bb-0310-9956-ffa450edef68
2016-03-01 22:29:50 +00:00
Rainer Jung
fad21a6dbc Join multi-line MPM startup log messages into
single long lines.

Followup to r1725394 and r1725548.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1731929 13f79535-47bb-0310-9956-ffa450edef68
2016-02-23 19:03:00 +00:00
Rainer Jung
496a614645 Added many log numbers to log statements that
had none.

Handled all files in server/mpm/.

I used the coccinelle script provided by Stefan.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725394 13f79535-47bb-0310-9956-ffa450edef68
2016-01-19 00:20:55 +00:00
Rich Bowen
29603b5fe3 s/a a/a/g
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1690122 13f79535-47bb-0310-9956-ffa450edef68
2015-07-09 16:07:25 +00:00
Yann Ylavic
d2bec9df64 core: ensure that MPMs return an error on runtime failure and hence that
httpd's main process also exits with an error.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629925 13f79535-47bb-0310-9956-ffa450edef68
2014-10-07 16:54:31 +00:00
Stefan Fritsch
67fde08ec7 Fix usage of MOD_* variables for MPM modules
r1385216 broke building of mpm event with serf support. To fix,

* introduce APACHE_MPMPATH_INIT/FINISH similar to
  APACHE_MODPATH_INIT/FINISH to create modules.mk and add
  MOD_* vars to it.
* change APACHE_MPM_MODULE to only append to modules.mk, not
  overwrite
* add APACHE_MPMPATH_INIT/FINISH to all MPMs


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1395252 13f79535-47bb-0310-9956-ffa450edef68
2012-10-07 08:56:45 +00:00
Joe Orton
fd967eab44 * include/httpd.h, server/mpm/*/*.h: Tidy up doxygen tree view by moving
private interfaces into a separate group.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1211490 13f79535-47bb-0310-9956-ffa450edef68
2011-12-07 16:06:16 +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
Jim Jagielski
103f776c25 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@1174748 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:38:09 +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
f60e484691 fill in conn_rec::current_thread for WinNT, NetWare, and OS/2 MPMs
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1103595 13f79535-47bb-0310-9956-ffa450edef68
2011-05-16 02:19:42 +00:00
Jeff Trawick
573a235d3b the mpm-note-child-killed hook is just for state sync between
ap_{reclaim,relieve}_child_processes() and their callers

the NetWare and OS/2 MPMs don't use that


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086948 13f79535-47bb-0310-9956-ffa450edef68
2011-03-30 13:32:21 +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
044e80c621 ap_max_requests_per_child is a global
(otherwise, this local one doesn't match the one used by the OS/2 child
code or the MaxConnectionsPerChild directive)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086246 13f79535-47bb-0310-9956-ffa450edef68
2011-03-28 14:13:37 +00:00
Jeff Trawick
d1ac3fd574 some non-MPM code wants to see DEFAULT_PIDLOG, so liberate the
setting from the MPM-specific mpm_default.h

now visible again via httpd -V


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086243 13f79535-47bb-0310-9956-ffa450edef68
2011-03-28 14:04:23 +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
Eric Covener
b0c950bd71 PR#47782: compiled-in default for MaxConnectionsPerChild is 10,000 vs the
recommendations in the default conf and the manual.  

Principle of least astonishment says to use a baked-in value of zero until
an admin asks for processes to exit this way.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1031657 13f79535-47bb-0310-9956-ffa450edef68
2010-11-05 16:29:08 +00:00
Brian Havard
22d2c7297e OS/2: Add support for ThreadStackSize.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@956863 13f79535-47bb-0310-9956-ffa450edef68
2010-06-22 12:49:59 +00:00
Brian Havard
c07640c285 Remove definition of ap_pid_fname from OS/2 MPM. It's now in mpm_common.c.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@956815 13f79535-47bb-0310-9956-ffa450edef68
2010-06-22 08:48:29 +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
Jeff Trawick
01026cbc46 remove dead code related to the accept mutex
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@882943 13f79535-47bb-0310-9956-ffa450edef68
2009-11-21 17:18:39 +00:00
Jeff Trawick
d4e7b85b2f Change the configure-based MPM build mechanism to support building
an MPM as a shared shared or dynamic module, primarily using the
APACHE_MPM_MODULE() function.

--enable-mpms-shared now builds/installs the MPMs as dynamic modules.
(But no LoadModule directives are added.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832434 13f79535-47bb-0310-9956-ffa450edef68
2009-11-03 14:36:48 +00:00
Brian Havard
392910c73c Brind OS/2 MPM up to date with current API.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832409 13f79535-47bb-0310-9956-ffa450edef68
2009-11-03 13:29:31 +00:00
Jeff Trawick
33e15a38e8 more configure-time support for dynamically loadable MPMs:
. axe --with-mpm="shared" hack, replace with --enable-mpms-shared={all|list}
. replace singular MPM_NAME with access to the list of enabled MPMs
. replace singular MPM_SUBDIR with list MPM_SUBDIRS
. enable OS/2 MPM in same manner as others with configure support instead of
  hard-coding in configure.in

Current state: MPMs are built as static archives (but not linked to httpd) with
--enable-mpms-shared, so they still have to be built with apxs to load 
dynamically.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832228 13f79535-47bb-0310-9956-ffa450edef68
2009-11-03 00:38:06 +00:00
Brian Havard
b975e90af4 Bring OS/2 MPM back from the dead.
Reverses r758899.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@804678 13f79535-47bb-0310-9956-ffa450edef68
2009-08-16 12:03:34 +00:00
Jeff Trawick
e64b014d3e remove OS/2 MPM
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758899 13f79535-47bb-0310-9956-ffa450edef68
2009-03-26 22:35:11 +00:00
Paul Querna
a324a1d72f Remove all references to CORE_PRIVATE.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645455 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 10:45:43 +00:00
Paul Querna
5fa2bbbdeb Remove ap_graceful_stop_signalled from all MPMs.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645437 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 10:00:32 +00:00
Joe Orton
ada9c28dcf Revert r547987 ("svn merge -c -547987 .")
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@551835 13f79535-47bb-0310-9956-ffa450edef68
2007-06-29 09:31:11 +00:00
Jim Jagielski
86f602beb2 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@547987 13f79535-47bb-0310-9956-ffa450edef68
2007-06-16 21:29:24 +00:00
Jeff Trawick
743a621e8d 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().



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@440337 13f79535-47bb-0310-9956-ffa450edef68
2006-09-05 13:08:15 +00:00
Chris Darroch
e69f467709 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.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@431460 13f79535-47bb-0310-9956-ffa450edef68
2006-08-14 22:55:45 +00:00
Roy T. Fielding
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
Colm MacCarthaigh
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
Jim Jagielski
08c97ba290 No functional change: remove "internal" tab spacing/formatting.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@345053 13f79535-47bb-0310-9956-ffa450edef68
2005-11-16 16:31:25 +00:00
Jim Jagielski
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
Jim Jagielski
5d2fae4818 No functional change: simple detabbing of indented code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332305 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:05:51 +00:00
Ian Holsman
8c1e315d3f Doxygen fixup / cleanup
submited by: Neale Ranns neale ranns.org
reviewed by: Ian Holsman



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@263931 13f79535-47bb-0310-9956-ffa450edef68
2005-08-28 23:03:59 +00:00
Justin Erenkrantz
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
Joe Orton
c36ecfa64f Remove the .cvsignore files.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105796 13f79535-47bb-0310-9956-ffa450edef68
2004-11-19 09:07:29 +00:00
André Malo
eeb57c17ad fix name of The Apache Software Foundation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102619 13f79535-47bb-0310-9956-ffa450edef68
2004-02-09 20:40:53 +00:00
André Malo
db7e0166ec fix copyright dates according to the first check in
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102583 13f79535-47bb-0310-9956-ffa450edef68
2004-02-08 13:41:23 +00:00
André Malo
4f02cb1e18 apply Apache License, Version 2.0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102525 13f79535-47bb-0310-9956-ffa450edef68
2004-02-06 22:58:42 +00:00
André Malo
fb07607180 update license to 2004.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102135 13f79535-47bb-0310-9956-ffa450edef68
2004-01-01 13:26:26 +00:00
Brian Havard
eeb0224f02 Rework OS/2 MPM to use the pollset API.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101826 13f79535-47bb-0310-9956-ffa450edef68
2003-11-20 22:28:15 +00:00
Brian Havard
4c43adfd90 OS/2: AP_MPM_WANT_SET_MAX_MEM_FREE needs to be defined for ap_max_mem_free to
be available which is required for the recent bucket_alloc changes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101200 13f79535-47bb-0310-9956-ffa450edef68
2003-09-08 22:32:36 +00:00