1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-07 04:02:58 +03:00

47 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
Jeff Trawick
aa21671e13 switch to APR 1.0 API (which is still in flux)
because of the changes to the argument lists of apr_mmap_dup and apr_socket_create,
2.1-dev won't build with apr and apr-util's 0.9 branch anymore


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101154 13f79535-47bb-0310-9956-ffa450edef68
2003-09-03 19:27:12 +00:00
Cliff Woolley
a770ae9e77 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101122 13f79535-47bb-0310-9956-ffa450edef68
2003-08-28 05:54:44 +00:00
André Malo
742af25096 finished that boring job:
update license to 2003.

Happy New Year! ;-))


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98573 13f79535-47bb-0310-9956-ffa450edef68
2003-02-03 17:53:28 +00:00
Ryan Bloom
2c94ecadce 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96005 13f79535-47bb-0310-9956-ffa450edef68
2002-07-11 05:42:20 +00:00
Jeff Trawick
c871b41d3c stop using APLOG_NOERRNO in calls to ap_log_?error()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95149 13f79535-47bb-0310-9956-ffa450edef68
2002-05-17 11:11:39 +00:00
Brian Havard
9bdcd90181 When an exception in a worker thread initiates a child shutdown, get things
moving sooner by sending a SIGHUP to the accept thread, breaking it out
of its accept/poll.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94678 13f79535-47bb-0310-9956-ffa450edef68
2002-04-17 14:55:20 +00:00
Brian Havard
d98925fa0d apr_bucket_alloc_create() now registers a cleanup that does a
apr_bucket_alloc_destroy(). Don't double free by calling it explicitly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94641 13f79535-47bb-0310-9956-ffa450edef68
2002-04-14 06:18:13 +00:00
Brian Havard
40f49588c2 Destroy the connection pool (and therefore run the cleanups) before destroying
the bucket_alloc as the cleanups refer to buckets allocated by the
bucket_alloc.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94360 13f79535-47bb-0310-9956-ffa450edef68
2002-04-01 16:42:02 +00:00
Cliff Woolley
3e2ce19baf 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94304 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 08:17:26 +00:00
Roy T. Fielding
845cbfd508 Update our copyright for this year.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93918 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 20:48:07 +00:00
Brian Havard
700ef6886c When firing up a new child process, wipe clean the set of worker_score records
we're going to use as they could contain leftovers from a previous child.
This solves a problem where a non-graceful restart followed by a graceful
restart would leave previous generation children stuck waiting for non-existant
worker threads to terminate.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93548 13f79535-47bb-0310-9956-ffa450edef68
2002-02-23 11:52:14 +00:00
Bill Stoddard
bd3d360392 Reintroduce the create_connection hook. This hook is required to enable
modules to completely take over all network i/o from the core.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93171 13f79535-47bb-0310-9956-ffa450edef68
2002-02-01 22:16:31 +00:00
Bill Stoddard
4168820850 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93087 13f79535-47bb-0310-9956-ffa450edef68
2002-01-29 19:02:04 +00:00
Bill Stoddard
327e4989d5 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93050 13f79535-47bb-0310-9956-ffa450edef68
2002-01-27 12:52:08 +00:00
Brian Havard
5e35f192f3 Get OS/2 MPM working again after last scoreboard changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92808 13f79535-47bb-0310-9956-ffa450edef68
2002-01-10 15:09:18 +00:00
William A. Rowe Jr
7e1113f913 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92791 13f79535-47bb-0310-9956-ffa450edef68
2002-01-10 00:28:00 +00:00
Brian Havard
5002be2b85 Update OS/2 MPM to allow for run-time configurable scoreboard size.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92662 13f79535-47bb-0310-9956-ffa450edef68
2001-12-30 13:39:42 +00:00
Brian Havard
d6334951d8 Add a missing hook run.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92647 13f79535-47bb-0310-9956-ffa450edef68
2001-12-29 09:42:44 +00:00
Jeff Trawick
187e9ae3b9 Change core code to allow an MPM to set hard thread/server
limits at startup.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92512 13f79535-47bb-0310-9956-ffa450edef68
2001-12-18 13:48:54 +00:00
Ryan Bloom
a4f00625aa 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91968 13f79535-47bb-0310-9956-ffa450edef68
2001-11-15 20:49:54 +00:00
Ryan Bloom
695081280d Add the server_rec argument back to the create_connection hook.
Submitted by:	Greg Stein


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91913 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 20:29:54 +00:00
Ryan Bloom
26444e2900 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91889 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 01:24:42 +00:00
Ryan Bloom
0c05b625ac 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91887 13f79535-47bb-0310-9956-ffa450edef68
2001-11-12 23:49:08 +00:00
Ryan Bloom
13cf9521f5 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91832 13f79535-47bb-0310-9956-ffa450edef68
2001-11-10 18:26:30 +00:00
Brian Havard
e9726a9667 Catch exceptions in worker threads so a segfault doesn't kill all active
connections in the process. When this occurs, a graceful shutdown of the
child is initiated so any leaked resources & hosed memory is disposed of ASAP.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90400 13f79535-47bb-0310-9956-ffa450edef68
2001-08-20 16:10:57 +00:00
Brian Havard
fb552a539f New multi-process multi-threaded MPM for OS/2. Not fully polished but works
better than spmt_os2 already (graceful restarts actually work). A summary
of the process/thread structure is provided in the comments at the start
of mpmt_os2.c


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90289 13f79535-47bb-0310-9956-ffa450edef68
2001-08-17 17:07:34 +00:00