/[Apache-SVN]/httpd/httpd/branches/2.2.x/server/mpm/worker/worker.c
ViewVC logotype

Log of /httpd/httpd/branches/2.2.x/server/mpm/worker/worker.c

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (annotate)
Sticky Revision:

Revision 556936 - (view) (annotate) - [selected]
Modified Tue Jul 17 14:48:25 2007 UTC (2 years, 4 months ago) by jorton
File length: 81596 byte(s)
Diff to previous 446606 (colored)
Merge r551843, r551889 from trunk:

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.

* server/mpm_common.c: getpgid() returns a pid_t

Submitted by: jorton, jim
Reviewed by: jorton, jim, rpluem

Revision 446606 - (view) (annotate) - [select for diffs]
Modified Fri Sep 15 13:19:25 2006 UTC (3 years, 2 months ago) by trawick
File length: 81673 byte(s)
Diff to previous 424876 (colored) , to selected 556936 (colored)
merge from trunk (but preserve ap_get_server_version()):

  *) 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.  ap_get_server_version() is now 
     deprecated, and is replaced by ap_get_server_banner() and 
     ap_get_server_description().

Reviewed by: rpluem, jim


Revision 424876 - (view) (annotate) - [select for diffs]
Modified Mon Jul 24 01:43:24 2006 UTC (3 years, 4 months ago) by trawick
File length: 81669 byte(s)
Diff to previous 424874 (colored) , to selected 556936 (colored)
merge from trunk:

  Worker MPM: On graceless shutdown or restart, send signals to
  each worker thread to wake them up if they're polling on a
  Keep-Alive connection.  PR 38737.  [Chris Darroch]

PR: 38737
Reviewed by: chrisd, trawick, niq


Revision 424874 - (view) (annotate) - [select for diffs]
Modified Mon Jul 24 01:34:58 2006 UTC (3 years, 4 months ago) by trawick
File length: 80659 byte(s)
Diff to previous 421103 (colored) , to selected 556936 (colored)
merge from trunk:

  worker and event MPMs: fix excessive forking if fork() or child_init
  take a long time.

PR: 39275
Reviewed by: trawick, gregames, pquerna

Revision 421103 - (view) (annotate) - [select for diffs]
Modified Wed Jul 12 03:38:44 2006 UTC (3 years, 4 months ago) by fielding
File length: 80683 byte(s)
Diff to previous 410935 (colored) , to selected 556936 (colored)
update license header text

Revision 410935 - (view) (annotate) - [select for diffs]
Modified Thu Jun 1 20:12:51 2006 UTC (3 years, 5 months ago) by rpluem
File length: 80536 byte(s)
Diff to previous 396056 (colored) , to selected 556936 (colored)
Merge r377291 from trunk:

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.

Submitted by: chrisd, rooneg
Reviewed by: chrisd, rpluem, trawick
PR: 38621

Revision 396056 - (view) (annotate) - [select for diffs]
Modified Sat Apr 22 01:53:06 2006 UTC (3 years, 7 months ago) by pquerna
File length: 80313 byte(s)
Diff to previous 395231 (colored) , to selected 556936 (colored)
Revert r395231 from the 2.2.x branch.  This gets us back to the old place with regard to the copyright statements.

Revision 395231 - (view) (annotate) - [select for diffs]
Modified Wed Apr 19 12:33:16 2006 UTC (3 years, 7 months ago) by colm
File length: 80313 byte(s)
Diff to previous 332309 (colored) , to selected 556936 (colored)
Update the last year of copyright for the 2.2.x branch

Revision 332309 - (view) (annotate) - [select for diffs]
Modified Thu Nov 10 15:20:05 2005 UTC (4 years ago) by jim
File length: 80313 byte(s)
Diff to previous 332307 (colored) , to selected 556936 (colored)
No functional change: remove trailing whitespace. This also means
that "blank" lines, which had consisted of just spaces
and/or tabs are now truly blank lines

Revision 332307 - (view) (annotate) - [select for diffs]
Modified Thu Nov 10 15:15:41 2005 UTC (4 years ago) by jim
File length: 80666 byte(s)
Diff to previous 307222 (colored) , to selected 556936 (colored)
No functional change: detab all indenting to be consistent
with our formatting standards.

Revision 307222 - (view) (annotate) - [select for diffs]
Modified Sat Oct 8 00:11:36 2005 UTC (4 years, 1 month ago) by trawick
File length: 80589 byte(s)
Diff to previous 293164 (colored) , to selected 556936 (colored)
use Greg's cleaner fix for CAN-2005-2970

Revision 293164 - (view) (annotate) - [select for diffs]
Modified Sun Oct 2 20:56:56 2005 UTC (4 years, 1 month ago) by colm
File length: 80658 byte(s)
Diff to previous 292949 (colored) , to selected 556936 (colored)
Merge r265518-9 from trunk; explicit assignment of some global variables
to zero. These should not be neccessary, but help us get around a gcc
(on ia64 at least) optimisation bug. They are harmless anyway.

Revision 292949 - (view) (annotate) - [select for diffs]
Modified Sat Oct 1 11:02:10 2005 UTC (4 years, 1 month ago) by trawick
File length: 80650 byte(s)
Diff to previous 290189 (colored) , to selected 556936 (colored)
merge from trunk:

*) SECURITY: CAN-2005-2970 (cve.mitre.org)
     worker MPM: Fix a memory leak which can occur after an aborted
     connection in some limited circumstances.  [Greg Ames, Jeff Trawick]


Revision 290189 - (view) (annotate) - [select for diffs]
Modified Mon Sep 19 15:51:22 2005 UTC (4 years, 2 months ago) by colm
File length: 80495 byte(s)
Diff to previous 290179 (colored) , to selected 556936 (colored)
Backport graceful-stop to the 2.2.x branch.


Revision 290179 - (view) (annotate) - [select for diffs]
Modified Mon Sep 19 14:57:07 2005 UTC (4 years, 2 months ago) by colm
File length: 77968 byte(s)
Diff to previous 234103 (colored) , to selected 556936 (colored)
Backport r239710, r239711, r239732, r239740 and r241815 to the 2.2.x branch;
Fix PR 28167, which means we stop listening on ports when we do a
graceful-restart.


Revision 234103 - (view) (annotate) - [select for diffs]
Modified Sat Aug 20 18:21:45 2005 UTC (4 years, 3 months ago) by pquerna
File length: 77942 byte(s)
Diff to previous 179317 (colored) , to selected 556936 (colored)
Recreate 2.2.x branch from trunk.

Revision 179317 - (view) (annotate) - [select for diffs]
Modified Tue May 31 23:57:41 2005 UTC (4 years, 5 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 77942 byte(s)
Diff to previous 170896 (colored) , to selected 556936 (colored)
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

Revision 170896 - (view) (annotate) - [select for diffs]
Modified Thu May 19 09:01:22 2005 UTC (4 years, 6 months ago) by jorton
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 77657 byte(s)
Diff to previous 168649 (colored) , to selected 556936 (colored)
* 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

Revision 168649 - (view) (annotate) - [select for diffs]
Modified Fri May 6 20:37:05 2005 UTC (4 years, 6 months ago) by gregames
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 77656 byte(s)
Diff to previous 168182 (colored) , to selected 556936 (colored)
missed a couple.  

Revision 168182 - (view) (annotate) - [select for diffs]
Modified Wed May 4 20:00:23 2005 UTC (4 years, 6 months ago) by gregames
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 77820 byte(s)
Diff to previous 160211 (colored) , to selected 556936 (colored)
worker and event mpms: transient thread creation errors shouldn't take down
the whole server.

Revision 160211 - (view) (annotate) - [select for diffs]
Modified Tue Apr 5 19:45:32 2005 UTC (4 years, 7 months ago) by gregames
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 77148 byte(s)
Diff to previous 156274 (colored) , to selected 556936 (colored)
the style police have been sleeping

Revision 156274 - (view) (annotate) - [select for diffs]
Modified Sat Mar 5 20:06:55 2005 UTC (4 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 77144 byte(s)
Diff to previous 151408 (colored) , to selected 556936 (colored)
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.

Revision 151408 - (view) (annotate) - [select for diffs]
Modified Fri Feb 4 20:28:49 2005 UTC (4 years, 9 months ago) by jerenkrantz
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76976 byte(s)
Diff to previous 109510 (colored) , to selected 556936 (colored)
Update copyright year to 2005 and standardize on current copyright owner line.

Revision 109510 - (view) (annotate) - [select for diffs]
Modified Thu Dec 2 17:39:22 2004 UTC (4 years, 11 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76940 byte(s)
Diff to previous 106103 (colored) , to selected 556936 (colored)
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.)

Revision 106103 - (view) (annotate) - [select for diffs]
Modified Sun Nov 21 18:50:36 2004 UTC (5 years ago) by nd
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76010 byte(s)
Diff to previous 102975 (colored) , to selected 556936 (colored)
general property cleanup

Revision 102975 - (view) (annotate) - [select for diffs]
Modified Mon Mar 15 23:08:41 2004 UTC (5 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76010 byte(s)
Diff to previous 102931 (colored) , to selected 556936 (colored)
use existing directive name ThreadStackSize instead of
WorkerStackSize

as made obvious by: Brad Nicholes

Revision 102931 - (view) (annotate) - [select for diffs]
Modified Thu Mar 11 03:57:50 2004 UTC (5 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76010 byte(s)
Diff to previous 102619 (colored) , to selected 556936 (colored)
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.

Revision 102619 - (view) (annotate) - [select for diffs]
Modified Mon Feb 9 20:40:53 2004 UTC (5 years, 9 months ago) by nd
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 75891 byte(s)
Diff to previous 102587 (colored) , to selected 556936 (colored)
fix name of The Apache Software Foundation

Revision 102587 - (view) (annotate) - [select for diffs]
Modified Sun Feb 8 13:52:12 2004 UTC (5 years, 9 months ago) by nd
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 75887 byte(s)
Diff to previous 102525 (colored) , to selected 556936 (colored)
fix copyright dates according to the first checkin

Revision 102525 - (view) (annotate) - [select for diffs]
Modified Fri Feb 6 22:58:42 2004 UTC (5 years, 9 months ago) by nd
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 75887 byte(s)
Diff to previous 102425 (colored) , to selected 556936 (colored)
apply Apache License, Version 2.0

Revision 102425 - (view) (annotate) - [select for diffs]
Modified Wed Jan 28 15:31:02 2004 UTC (5 years, 9 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78106 byte(s)
Diff to previous 102419 (colored) , to selected 556936 (colored)
worker MPM: fix stack overlay bug that could cause the parent
process to crash.

Revision 102419 - (view) (annotate) - [select for diffs]
Modified Tue Jan 27 15:19:58 2004 UTC (5 years, 10 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78059 byte(s)
Diff to previous 102135 (colored) , to selected 556936 (colored)
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.

Revision 102135 - (view) (annotate) - [select for diffs]
Modified Thu Jan 1 13:26:26 2004 UTC (5 years, 10 months ago) by nd
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78425 byte(s)
Diff to previous 102047 (colored) , to selected 556936 (colored)
update license to 2004.

Revision 102047 - (view) (annotate) - [select for diffs]
Modified Sat Dec 13 19:43:40 2003 UTC (5 years, 11 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78425 byte(s)
Diff to previous 102045 (colored) , to selected 556936 (colored)
remove inadvertent commit of clumsy gdb workaround (sorry!)

Revision 102045 - (view) (annotate) - [select for diffs]
Modified Sat Dec 13 19:00:56 2003 UTC (5 years, 11 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78493 byte(s)
Diff to previous 101858 (colored) , to selected 556936 (colored)
update leader, threadpool, and worker MPMs to return MPM state
from ap_mpm_query()

Revision 101858 - (view) (annotate) - [select for diffs]
Modified Mon Nov 24 01:34:04 2003 UTC (6 years ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 77565 byte(s)
Diff to previous 101801 (colored) , to selected 556936 (colored)
remove calls to the apr_proc_other_child_read function that no longer exists

Revision 101801 - (view) (annotate) - [select for diffs]
Modified Sun Nov 16 23:47:07 2003 UTC (6 years ago) by gstein
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 77495 byte(s)
Diff to previous 101165 (colored) , to selected 556936 (colored)
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.

Revision 101165 - (view) (annotate) - [select for diffs]
Modified Fri Sep 5 19:36:26 2003 UTC (6 years, 2 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76558 byte(s)
Diff to previous 101160 (colored) , to selected 556936 (colored)
Lower the severity of the "listener thread didn't exit" message
to debug, as it is of interest only to developers.

PR:                9011

Revision 101160 - (view) (annotate) - [select for diffs]
Modified Fri Sep 5 16:50:22 2003 UTC (6 years, 2 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76557 byte(s)
Diff to previous 101122 (colored) , to selected 556936 (colored)
Fix a misleading message from the some of the threaded MPMs when
MaxClients has to be lowered due to the setting of ServerLimit.

Revision 101122 - (view) (annotate) - [select for diffs]
Modified Thu Aug 28 05:54:44 2003 UTC (6 years, 3 months ago) by jwoolley
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76534 byte(s)
Diff to previous 101117 (colored) , to selected 556936 (colored)
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

Revision 101117 - (view) (annotate) - [select for diffs]
Modified Wed Aug 27 22:33:12 2003 UTC (6 years, 3 months ago) by bnicholes
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76594 byte(s)
Diff to previous 99312 (colored) , to selected 556936 (colored)
Make sure that the global ap_max_mem_free is initialized along with the
other MPM globals whenever HTTPD is started or restarted.

Revision 99312 - (view) (annotate) - [select for diffs]
Modified Wed Apr 9 16:58:30 2003 UTC (6 years, 7 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76498 byte(s)
Diff to previous 98573 (colored) , to selected 556936 (colored)
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

Revision 98573 - (view) (annotate) - [select for diffs]
Modified Mon Feb 3 17:53:28 2003 UTC (6 years, 9 months ago) by nd
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 79019 byte(s)
Diff to previous 96558 (colored) , to selected 556936 (colored)
finished that boring job:
update license to 2003.

Happy New Year! ;-))

Revision 96558 - (view) (annotate) - [select for diffs]
Modified Wed Aug 28 18:48:07 2002 UTC (7 years, 3 months ago) by jim
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 79019 byte(s)
Diff to previous 96463 (colored) , to selected 556936 (colored)
Adjust the descriptions of these directives, avoid the child/process/thread
confusion.
PR:
Obtained from:
Submitted by:
Reviewed by:

Revision 96463 - (view) (annotate) - [select for diffs]
Modified Wed Aug 21 13:32:16 2002 UTC (7 years, 3 months ago) by jim
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78966 byte(s)
Diff to previous 96005 (colored) , to selected 556936 (colored)
Minor error log typo

Revision 96005 - (view) (annotate) - [select for diffs]
Modified Thu Jul 11 05:42:20 2002 UTC (7 years, 4 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78972 byte(s)
Diff to previous 95959 (colored) , to selected 556936 (colored)
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.

Revision 95959 - (view) (annotate) - [select for diffs]
Modified Thu Jul 4 22:41:48 2002 UTC (7 years, 4 months ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78933 byte(s)
Diff to previous 95954 (colored) , to selected 556936 (colored)
replaced APR_USEC_PER_SEC division with the new time macros

Revision 95954 - (view) (annotate) - [select for diffs]
Modified Thu Jul 4 15:20:54 2002 UTC (7 years, 4 months ago) by striker
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78929 byte(s)
Diff to previous 95568 (colored) , to selected 556936 (colored)
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.

Revision 95568 - (view) (annotate) - [select for diffs]
Modified Fri Jun 7 14:08:05 2002 UTC (7 years, 5 months ago) by jim
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78857 byte(s)
Diff to previous 95373 (colored) , to selected 556936 (colored)
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:

Revision 95373 - (view) (annotate) - [select for diffs]
Modified Thu May 30 00:21:27 2002 UTC (7 years, 6 months ago) by striker
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78808 byte(s)
Diff to previous 95270 (colored) , to selected 556936 (colored)
Catch up with the apr_allocator_set_owner -> apr_allocator_owner_set renames
in APR.

Revision 95270 - (view) (annotate) - [select for diffs]
Modified Fri May 24 19:50:58 2002 UTC (7 years, 6 months ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78808 byte(s)
Diff to previous 95237 (colored) , to selected 556936 (colored)
Fix for the worker deadlock problem

Revision 95237 - (view) (annotate) - [select for diffs]
Modified Thu May 23 12:58:37 2002 UTC (7 years, 6 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78419 byte(s)
Diff to previous 95149 (colored) , to selected 556936 (colored)
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.

Revision 95149 - (view) (annotate) - [select for diffs]
Modified Fri May 17 11:11:39 2002 UTC (7 years, 6 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78419 byte(s)
Diff to previous 94892 (colored) , to selected 556936 (colored)
stop using APLOG_NOERRNO in calls to ap_log_?error()

Revision 94892 - (view) (annotate) - [select for diffs]
Modified Wed May 1 16:05:59 2002 UTC (7 years, 6 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 79015 byte(s)
Diff to previous 94889 (colored) , to selected 556936 (colored)
wait for worker threads to exit even in graceless termination
(we already have code to make them exit sooner now)

Revision 94889 - (view) (annotate) - [select for diffs]
Modified Wed May 1 15:06:44 2002 UTC (7 years, 6 months ago) by stoddard
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 79090 byte(s)
Diff to previous 94886 (colored) , to selected 556936 (colored)
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.

Revision 94886 - (view) (annotate) - [select for diffs]
Modified Wed May 1 07:15:39 2002 UTC (7 years, 6 months ago) by jerenkrantz
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 79131 byte(s)
Diff to previous 94840 (colored) , to selected 556936 (colored)
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

Revision 94840 - (view) (annotate) - [select for diffs]
Modified Sun Apr 28 22:13:32 2002 UTC (7 years, 7 months ago) by aaron
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78429 byte(s)
Diff to previous 94830 (colored) , to selected 556936 (colored)
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

Revision 94830 - (view) (annotate) - [select for diffs]
Modified Sun Apr 28 05:28:18 2002 UTC (7 years, 7 months ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78224 byte(s)
Diff to previous 94824 (colored) , to selected 556936 (colored)
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.

Revision 94824 - (view) (annotate) - [select for diffs]
Modified Sun Apr 28 01:45:00 2002 UTC (7 years, 7 months ago) by aaron
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 78165 byte(s)
Diff to previous 94700 (colored) , to selected 556936 (colored)
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.

Revision 94700 - (view) (annotate) - [select for diffs]
Modified Thu Apr 18 17:46:20 2002 UTC (7 years, 7 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76871 byte(s)
Diff to previous 94679 (colored) , to selected 556936 (colored)
back out ill-conceived attempt to fix a segfault during
graceless termination

Revision 94679 - (view) (annotate) - [select for diffs]
Modified Wed Apr 17 15:45:27 2002 UTC (7 years, 7 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 77321 byte(s)
Diff to previous 94625 (colored) , to selected 556936 (colored)
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

Revision 94625 - (view) (annotate) - [select for diffs]
Modified Fri Apr 12 19:58:52 2002 UTC (7 years, 7 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76871 byte(s)
Diff to previous 94541 (colored) , to selected 556936 (colored)
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.

Revision 94541 - (view) (annotate) - [select for diffs]
Modified Mon Apr 8 16:57:06 2002 UTC (7 years, 7 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76945 byte(s)
Diff to previous 94443 (colored) , to selected 556936 (colored)
Remind the admin about the User and Group directives when we are
unable to set permissions on a semaphore.

PR:    7812

Revision 94443 - (view) (annotate) - [select for diffs]
Modified Fri Apr 5 02:23:02 2002 UTC (7 years, 7 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76884 byte(s)
Diff to previous 94441 (colored) , to selected 556936 (colored)
quiet a bogus gcc warning that crops up with -O2

Revision 94441 - (view) (annotate) - [select for diffs]
Modified Fri Apr 5 00:18:14 2002 UTC (7 years, 7 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76861 byte(s)
Diff to previous 94420 (colored) , to selected 556936 (colored)
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

Revision 94420 - (view) (annotate) - [select for diffs]
Modified Wed Apr 3 15:47:59 2002 UTC (7 years, 7 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76773 byte(s)
Diff to previous 94417 (colored) , to selected 556936 (colored)
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.

Revision 94417 - (view) (annotate) - [select for diffs]
Modified Wed Apr 3 13:10:56 2002 UTC (7 years, 7 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76563 byte(s)
Diff to previous 94306 (colored) , to selected 556936 (colored)
Allow worker MPM to build on systems without pthread_kill().

Submitted by:  Pier Fumagalli (and mangled by Jeff)

Revision 94306 - (view) (annotate) - [select for diffs]
Modified Fri Mar 29 14:33:50 2002 UTC (7 years, 8 months ago) by jim
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76366 byte(s)
Diff to previous 94304 (colored) , to selected 556936 (colored)
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:

Revision 94304 - (view) (annotate) - [select for diffs]
Modified Fri Mar 29 08:17:26 2002 UTC (7 years, 8 months ago) by jwoolley
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76466 byte(s)
Diff to previous 94232 (colored) , to selected 556936 (colored)
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.

Revision 94232 - (view) (annotate) - [select for diffs]
Modified Wed Mar 27 20:37:32 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 76205 byte(s)
Diff to previous 94117 (colored) , to selected 556936 (colored)
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

Revision 94117 - (view) (annotate) - [select for diffs]
Modified Fri Mar 22 03:43:22 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 75881 byte(s)
Diff to previous 94112 (colored) , to selected 556936 (colored)
document yet another worker MPM glitch

Revision 94112 - (view) (annotate) - [select for diffs]
Modified Fri Mar 22 01:12:49 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 75483 byte(s)
Diff to previous 94106 (colored) , to selected 556936 (colored)
remove some unnecessary, commented-out code; add a comment
about a use of signals

Revision 94106 - (view) (annotate) - [select for diffs]
Modified Thu Mar 21 19:12:54 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 75424 byte(s)
Diff to previous 94095 (colored) , to selected 556936 (colored)
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.

Revision 94095 - (view) (annotate) - [select for diffs]
Modified Thu Mar 21 16:31:39 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 74794 byte(s)
Diff to previous 94094 (colored) , to selected 556936 (colored)
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

Revision 94094 - (view) (annotate) - [select for diffs]
Modified Thu Mar 21 16:18:11 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 74254 byte(s)
Diff to previous 94091 (colored) , to selected 556936 (colored)
document a glitch that prevents complete graceful termination of the
process when one of the threads encounters a critical error

Revision 94091 - (view) (annotate) - [select for diffs]
Modified Thu Mar 21 16:06:51 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 73876 byte(s)
Diff to previous 94068 (colored) , to selected 556936 (colored)
make the comment for the call to apr_signal_thread() a little more
correct about what it is going to do

Revision 94068 - (view) (annotate) - [select for diffs]
Modified Thu Mar 21 03:40:23 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 73876 byte(s)
Diff to previous 94067 (colored) , to selected 556936 (colored)
don't log a failure of ap_queue_pop() at termination; it is
expected

Revision 94067 - (view) (annotate) - [select for diffs]
Modified Wed Mar 20 23:29:13 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 73102 byte(s)
Diff to previous 94062 (colored) , to selected 556936 (colored)
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

Revision 94062 - (view) (annotate) - [select for diffs]
Modified Wed Mar 20 22:19:11 2002 UTC (7 years, 8 months ago) by jim
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 72904 byte(s)
Diff to previous 94061 (colored) , to selected 556936 (colored)
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:

Revision 94061 - (view) (annotate) - [select for diffs]
Modified Wed Mar 20 20:38:52 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 72907 byte(s)
Diff to previous 94059 (colored) , to selected 556936 (colored)
no need to kill the scoreboard cleanup anymore on graceful
restart; the scoreboard is longer-lived
PR:
Obtained from:
Submitted by:
Reviewed by:

Revision 94059 - (view) (annotate) - [select for diffs]
Modified Wed Mar 20 19:53:18 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 73003 byte(s)
Diff to previous 94055 (colored) , to selected 556936 (colored)
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

Revision 94055 - (view) (annotate) - [select for diffs]
Modified Wed Mar 20 16:44:13 2002 UTC (7 years, 8 months ago) by jim
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 72630 byte(s)
Diff to previous 94039 (colored) , to selected 556936 (colored)
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:

Revision 94039 - (view) (annotate) - [select for diffs]
Modified Wed Mar 20 05:58:21 2002 UTC (7 years, 8 months ago) by wrowe
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 72453 byte(s)
Diff to previous 94031 (colored) , to selected 556936 (colored)
  The pre_mpm hook creates server-lifetime objects (or at least, for the
  generations across graceful restarts.)  They should use the process pool.

Revision 94031 - (view) (annotate) - [select for diffs]
Modified Wed Mar 20 03:54:25 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 72442 byte(s)
Diff to previous 94030 (colored) , to selected 556936 (colored)
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:

Revision 94030 - (view) (annotate) - [select for diffs]
Modified Wed Mar 20 03:38:07 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 69519 byte(s)
Diff to previous 94025 (colored) , to selected 556936 (colored)
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

Revision 94025 - (view) (annotate) - [select for diffs]
Modified Tue Mar 19 22:09:26 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 68897 byte(s)
Diff to previous 94024 (colored) , to selected 556936 (colored)
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

Revision 94024 - (view) (annotate) - [select for diffs]
Modified Tue Mar 19 21:31:04 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 68895 byte(s)
Diff to previous 94017 (colored) , to selected 556936 (colored)
"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

Revision 94017 - (view) (annotate) - [select for diffs]
Modified Tue Mar 19 17:56:57 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 68746 byte(s)
Diff to previous 93998 (colored) , to selected 556936 (colored)
get rid of unnecessary code to track the number of worker threads

Revision 93998 - (view) (annotate) - [select for diffs]
Modified Mon Mar 18 18:12:43 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 69321 byte(s)
Diff to previous 93969 (colored) , to selected 556936 (colored)
prefork and worker:

after allocating a new scoreboard, make sure the right generation
is stored in the global score

Revision 93969 - (view) (annotate) - [select for diffs]
Modified Sat Mar 16 18:42:46 2002 UTC (7 years, 8 months ago) by wrowe
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 69090 byte(s)
Diff to previous 93943 (colored) , to selected 556936 (colored)
  Simplify s/APR_OS_PROC_T_FMT/APR_PID_T_FMT/, apr_os_foo entities aren't
  for external consumption.

Revision 93943 - (view) (annotate) - [select for diffs]
Modified Fri Mar 15 00:50:31 2002 UTC (7 years, 8 months ago) by striker
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 69094 byte(s)
Diff to previous 93918 (colored) , to selected 556936 (colored)
Update the mpms to call the new allocator/pools API

Revision 93918 - (view) (annotate) - [select for diffs]
Modified Wed Mar 13 20:48:07 2002 UTC (7 years, 8 months ago) by fielding
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 68953 byte(s)
Diff to previous 93720 (colored) , to selected 556936 (colored)
Update our copyright for this year.

Revision 93720 - (view) (annotate) - [select for diffs]
Modified Tue Mar 5 21:18:07 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 68953 byte(s)
Diff to previous 93719 (colored) , to selected 556936 (colored)
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

Revision 93719 - (view) (annotate) - [select for diffs]
Modified Tue Mar 5 21:01:24 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 68403 byte(s)
Diff to previous 93718 (colored) , to selected 556936 (colored)
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

Revision 93718 - (view) (annotate) - [select for diffs]
Modified Tue Mar 5 20:51:50 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 68401 byte(s)
Diff to previous 93561 (colored) , to selected 556936 (colored)
skip the lock release if the lock obtain failed

Revision 93561 - (view) (annotate) - [select for diffs]
Modified Sun Feb 24 20:53:26 2002 UTC (7 years, 9 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 68335 byte(s)
Diff to previous 93535 (colored) , to selected 556936 (colored)
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

Revision 93535 - (view) (annotate) - [select for diffs]
Modified Thu Feb 21 18:52:28 2002 UTC (7 years, 9 months ago) by aaron
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67513 byte(s)
Diff to previous 93530 (colored) , to selected 556936 (colored)
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

Revision 93530 - (view) (annotate) - [select for diffs]
Modified Thu Feb 21 14:22:05 2002 UTC (7 years, 9 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67413 byte(s)
Diff to previous 93528 (colored) , to selected 556936 (colored)
Convert the ap_queue_foo routines to return apr_status_t as appropriate.

Revision 93528 - (view) (annotate) - [select for diffs]
Modified Thu Feb 21 11:20:01 2002 UTC (7 years, 9 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67145 byte(s)
Diff to previous 93434 (colored) , to selected 556936 (colored)
zap an incorrect comment

Revision 93434 - (view) (annotate) - [select for diffs]
Modified Fri Feb 15 20:48:19 2002 UTC (7 years, 9 months ago) by aaron
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67167 byte(s)
Diff to previous 93403 (colored) , to selected 556936 (colored)
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

Revision 93403 - (view) (annotate) - [select for diffs]
Modified Thu Feb 14 02:48:19 2002 UTC (7 years, 9 months ago) by aaron
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67213 byte(s)
Diff to previous 93386 (colored) , to selected 556936 (colored)
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.

Revision 93386 - (view) (annotate) - [select for diffs]
Modified Wed Feb 13 04:49:55 2002 UTC (7 years, 9 months ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 65598 byte(s)
Diff to previous 93366 (colored) , to selected 556936 (colored)
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.

Revision 93366 - (view) (annotate) - [select for diffs]
Modified Mon Feb 11 23:20:16 2002 UTC (7 years, 9 months ago) by gregames
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 65272 byte(s)
Diff to previous 93358 (colored) , to selected 556936 (colored)
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

Revision 93358 - (view) (annotate) - [select for diffs]
Modified Mon Feb 11 04:56:10 2002 UTC (7 years, 9 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 64897 byte(s)
Diff to previous 93264 (colored) , to selected 556936 (colored)
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.

Revision 93264 - (view) (annotate) - [select for diffs]
Modified Tue Feb 5 23:17:22 2002 UTC (7 years, 9 months ago) by wrowe
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 65506 byte(s)
Diff to previous 93227 (colored) , to selected 556936 (colored)
  Some compatibility fixes.  Built yet untested, read three times through.
  Please review and raise the flag if any of these introduce bad mojo.

Revision 93227 - (view) (annotate) - [select for diffs]
Modified Mon Feb 4 18:41:46 2002 UTC (7 years, 9 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 65328 byte(s)
Diff to previous 93171 (colored) , to selected 556936 (colored)
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.

Revision 93171 - (view) (annotate) - [select for diffs]
Modified Fri Feb 1 22:16:31 2002 UTC (7 years, 9 months ago) by stoddard
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 64782 byte(s)
Diff to previous 93119 (colored) , to selected 556936 (colored)
Reintroduce the create_connection hook. This hook is required to enable
modules to completely take over all network i/o from the core.

Revision 93119 - (view) (annotate) - [select for diffs]
Modified Wed Jan 30 22:35:57 2002 UTC (7 years, 9 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 64775 byte(s)
Diff to previous 93101 (colored) , to selected 556936 (colored)
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.

Revision 93101 - (view) (annotate) - [select for diffs]
Modified Wed Jan 30 11:56:26 2002 UTC (7 years, 9 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 64766 byte(s)
Diff to previous 93096 (colored) , to selected 556936 (colored)
get rid of a bunch of warnings about unused variables

Revision 93096 - (view) (annotate) - [select for diffs]
Modified Wed Jan 30 06:33:18 2002 UTC (7 years, 9 months ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 64902 byte(s)
Diff to previous 93087 (colored) , to selected 556936 (colored)
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

Revision 93087 - (view) (annotate) - [select for diffs]
Modified Tue Jan 29 19:02:04 2002 UTC (7 years, 9 months ago) by stoddard
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67683 byte(s)
Diff to previous 93069 (colored) , to selected 556936 (colored)
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.

Revision 93069 - (view) (annotate) - [select for diffs]
Modified Tue Jan 29 02:41:46 2002 UTC (7 years, 9 months ago) by aaron
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67677 byte(s)
Diff to previous 93063 (colored) , to selected 556936 (colored)
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.

Revision 93063 - (view) (annotate) - [select for diffs]
Modified Mon Jan 28 23:49:40 2002 UTC (7 years, 9 months ago) by aaron
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67431 byte(s)
Diff to previous 93057 (colored) , to selected 556936 (colored)
The pre_config hook now takes a return value. This allows modules to
cause the server to bail out under error conditions.

Revision 93057 - (view) (annotate) - [select for diffs]
Modified Mon Jan 28 00:49:04 2002 UTC (7 years, 10 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67416 byte(s)
Diff to previous 93055 (colored) , to selected 556936 (colored)
zap an unintended (and incorrect) comment that slipped in with
the last commit; sorry!

Revision 93055 - (view) (annotate) - [select for diffs]
Modified Mon Jan 28 00:41:32 2002 UTC (7 years, 10 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67513 byte(s)
Diff to previous 93050 (colored) , to selected 556936 (colored)
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

Revision 93050 - (view) (annotate) - [select for diffs]
Modified Sun Jan 27 12:52:08 2002 UTC (7 years, 10 months ago) by stoddard
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67372 byte(s)
Diff to previous 92821 (colored) , to selected 556936 (colored)
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.

Revision 92821 - (view) (annotate) - [select for diffs]
Modified Fri Jan 11 08:01:11 2002 UTC (7 years, 10 months ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67379 byte(s)
Diff to previous 92791 (colored) , to selected 556936 (colored)
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.

Revision 92791 - (view) (annotate) - [select for diffs]
Modified Thu Jan 10 00:28:00 2002 UTC (7 years, 10 months ago) by wrowe
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67380 byte(s)
Diff to previous 92653 (colored) , to selected 556936 (colored)
  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.

Revision 92653 - (view) (annotate) - [select for diffs]
Modified Sat Dec 29 23:16:24 2001 UTC (7 years, 10 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67366 byte(s)
Diff to previous 92648 (colored) , to selected 556936 (colored)
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()

Revision 92648 - (view) (annotate) - [select for diffs]
Modified Sat Dec 29 17:36:17 2001 UTC (7 years, 10 months ago) by wrowe
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67579 byte(s)
Diff to previous 92632 (colored) , to selected 556936 (colored)
  mpm_common.c did all this dirty work - cleans up a duplicate symbol error
  from the OSX.1 build.

Revision 92632 - (view) (annotate) - [select for diffs]
Modified Thu Dec 27 23:40:55 2001 UTC (7 years, 11 months ago) by aaron
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67618 byte(s)
Diff to previous 92622 (colored) , to selected 556936 (colored)
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.

Revision 92622 - (view) (annotate) - [select for diffs]
Modified Thu Dec 27 17:06:40 2001 UTC (7 years, 11 months ago) by aaron
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67086 byte(s)
Diff to previous 92598 (colored) , to selected 556936 (colored)
Take advantage of the new usable apr_thread_exit().

Revision 92598 - (view) (annotate) - [select for diffs]
Modified Tue Dec 25 12:24:14 2001 UTC (7 years, 11 months ago) by dreid
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67169 byte(s)
Diff to previous 92597 (colored) , to selected 556936 (colored)
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.

Revision 92597 - (view) (annotate) - [select for diffs]
Modified Tue Dec 25 02:34:29 2001 UTC (7 years, 11 months ago) by dreid
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67169 byte(s)
Diff to previous 92596 (colored) , to selected 556936 (colored)
unixd.h is included in mpm.h so shouldn't need to be included here as well.

Revision 92596 - (view) (annotate) - [select for diffs]
Modified Tue Dec 25 02:30:53 2001 UTC (7 years, 11 months ago) by dreid
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 67188 byte(s)
Diff to previous 92581 (colored) , to selected 556936 (colored)
This allows platforms without the _NP locking palaver to build
the worker MPM.

Revision 92581 - (view) (annotate) - [select for diffs]
Modified Sun Dec 23 13:56:49 2001 UTC (7 years, 11 months ago) by dreid
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 66980 byte(s)
Diff to previous 92530 (colored) , to selected 556936 (colored)
This fixes a segfault that showed up on BeOS and may catch other systems.

Revision 92530 - (view) (annotate) - [select for diffs]
Modified Wed Dec 19 14:49:22 2001 UTC (7 years, 11 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 66952 byte(s)
Diff to previous 92521 (colored) , to selected 556936 (colored)
Add directives to worker and preform MPMs so that the admin can set
the equivalent of HARD_SERVER_LIMIT/HARD_THREAD_LIMIT at startup.

Revision 92521 - (view) (annotate) - [select for diffs]
Modified Tue Dec 18 21:33:27 2001 UTC (7 years, 11 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 63117 byte(s)
Diff to previous 92512 (colored) , to selected 556936 (colored)
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

Revision 92512 - (view) (annotate) - [select for diffs]
Modified Tue Dec 18 13:48:54 2001 UTC (7 years, 11 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 62972 byte(s)
Diff to previous 92482 (colored) , to selected 556936 (colored)
Change core code to allow an MPM to set hard thread/server
limits at startup.

Revision 92482 - (view) (annotate) - [select for diffs]
Modified Fri Dec 14 16:29:43 2001 UTC (7 years, 11 months ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 61639 byte(s)
Diff to previous 92473 (colored) , to selected 556936 (colored)
Use the new APR pool code to reduce pool-related lock
contention in the worker MPM.
Submitted by:	Sander Striker
Reviewed by:	Brian Pane

Revision 92473 - (view) (annotate) - [select for diffs]
Modified Fri Dec 14 06:10:38 2001 UTC (7 years, 11 months ago) by jerenkrantz
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 61556 byte(s)
Diff to previous 92412 (colored) , to selected 556936 (colored)
Style change.  Convert tabs->spaces, shorten long lines, etc, etc, etc.

Revision 92412 - (view) (annotate) - [select for diffs]
Modified Mon Dec 10 20:17:36 2001 UTC (7 years, 11 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58464 byte(s)
Diff to previous 92387 (colored) , to selected 556936 (colored)
get worker MPM to respect the LockFile setting

Revision 92387 - (view) (annotate) - [select for diffs]
Modified Sat Dec 8 01:38:05 2001 UTC (7 years, 11 months ago) by jerenkrantz
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58472 byte(s)
Diff to previous 92130 (colored) , to selected 556936 (colored)
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

Revision 92130 - (view) (annotate) - [select for diffs]
Modified Thu Nov 22 05:13:29 2001 UTC (8 years ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58383 byte(s)
Diff to previous 92019 (colored) , to selected 556936 (colored)
fix segv in worker MPM following check_pipe_of_death() call

Revision 92019 - (view) (annotate) - [select for diffs]
Modified Sat Nov 17 14:02:26 2001 UTC (8 years ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58366 byte(s)
Diff to previous 91968 (colored) , to selected 556936 (colored)
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.

Revision 91968 - (view) (annotate) - [select for diffs]
Modified Thu Nov 15 20:49:54 2001 UTC (8 years ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58167 byte(s)
Diff to previous 91960 (colored) , to selected 556936 (colored)
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.

Revision 91960 - (view) (annotate) - [select for diffs]
Modified Thu Nov 15 00:08:26 2001 UTC (8 years ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58125 byte(s)
Diff to previous 91955 (colored) , to selected 556936 (colored)
Get rid of the listensocks array.  It was just duplicating the ap_listeners
list.  No reason to have the same information stored twice.

Revision 91955 - (view) (annotate) - [select for diffs]
Modified Wed Nov 14 23:13:27 2001 UTC (8 years ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58561 byte(s)
Diff to previous 91913 (colored) , to selected 556936 (colored)
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.

Revision 91913 - (view) (annotate) - [select for diffs]
Modified Tue Nov 13 20:29:54 2001 UTC (8 years ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58299 byte(s)
Diff to previous 91896 (colored) , to selected 556936 (colored)
Add the server_rec argument back to the create_connection hook.
Submitted by:	Greg Stein

Revision 91896 - (view) (annotate) - [select for diffs]
Modified Tue Nov 13 06:04:25 2001 UTC (8 years ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58283 byte(s)
Diff to previous 91889 (colored) , to selected 556936 (colored)
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

Revision 91889 - (view) (annotate) - [select for diffs]
Modified Tue Nov 13 01:24:42 2001 UTC (8 years ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58281 byte(s)
Diff to previous 91887 (colored) , to selected 556936 (colored)
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.

Revision 91887 - (view) (annotate) - [select for diffs]
Modified Mon Nov 12 23:49:08 2001 UTC (8 years ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58315 byte(s)
Diff to previous 91880 (colored) , to selected 556936 (colored)
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.

Revision 91880 - (view) (annotate) - [select for diffs]
Modified Mon Nov 12 17:50:59 2001 UTC (8 years ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58324 byte(s)
Diff to previous 91832 (colored) , to selected 556936 (colored)
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.

Revision 91832 - (view) (annotate) - [select for diffs]
Modified Sat Nov 10 18:26:30 2001 UTC (8 years ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58261 byte(s)
Diff to previous 91777 (colored) , to selected 556936 (colored)
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.

Revision 91777 - (view) (annotate) - [select for diffs]
Modified Wed Nov 7 05:29:58 2001 UTC (8 years ago) by jwoolley
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58303 byte(s)
Diff to previous 91648 (colored) , to selected 556936 (colored)
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.

Revision 91648 - (view) (annotate) - [select for diffs]
Modified Tue Oct 23 17:30:07 2001 UTC (8 years, 1 month ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58303 byte(s)
Diff to previous 91582 (colored) , to selected 556936 (colored)
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

Revision 91582 - (view) (annotate) - [select for diffs]
Modified Fri Oct 19 23:45:39 2001 UTC (8 years, 1 month ago) by aaron
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58263 byte(s)
Diff to previous 91580 (colored) , to selected 556936 (colored)
Missed some error messages in the switch to the new lock system. Added
the proc_mutex header for the sake of consistency.

Revision 91580 - (view) (annotate) - [select for diffs]
Modified Fri Oct 19 23:36:55 2001 UTC (8 years, 1 month ago) by aaron
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58224 byte(s)
Diff to previous 91518 (colored) , to selected 556936 (colored)
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?

Revision 91518 - (view) (annotate) - [select for diffs]
Modified Wed Oct 17 00:59:18 2001 UTC (8 years, 1 month ago) by aaron
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58178 byte(s)
Diff to previous 91122 (colored) , to selected 556936 (colored)
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.

Revision 91122 - (view) (annotate) - [select for diffs]
Modified Mon Sep 24 06:42:12 2001 UTC (8 years, 2 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 58130 byte(s)
Diff to previous 91089 (colored) , to selected 556936 (colored)
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>

Revision 91089 - (view) (annotate) - [select for diffs]
Modified Wed Sep 19 18:47:31 2001 UTC (8 years, 2 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 54895 byte(s)
Diff to previous 91082 (colored) , to selected 556936 (colored)
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

Revision 91082 - (view) (annotate) - [select for diffs]
Modified Wed Sep 19 06:34:11 2001 UTC (8 years, 2 months ago) by jwoolley
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 54469 byte(s)
Diff to previous 91079 (colored) , to selected 556936 (colored)
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.

Revision 91079 - (view) (annotate) - [select for diffs]
Modified Wed Sep 19 05:58:09 2001 UTC (8 years, 2 months ago) by jerenkrantz
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 54655 byte(s)
Diff to previous 91076 (colored) , to selected 556936 (colored)
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

Revision 91076 - (view) (annotate) - [select for diffs]
Modified Tue Sep 18 22:13:59 2001 UTC (8 years, 2 months ago) by jerenkrantz
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 54382 byte(s)
Diff to previous 91075 (colored) , to selected 556936 (colored)
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.

Revision 91075 - (view) (annotate) - [select for diffs]
Modified Tue Sep 18 21:14:18 2001 UTC (8 years, 2 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 54270 byte(s)
Diff to previous 90824 (colored) , to selected 556936 (colored)
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>

Revision 90824 - (view) (annotate) - [select for diffs]
Modified Thu Aug 30 20:50:06 2001 UTC (8 years, 2 months ago) by jerenkrantz
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 55486 byte(s)
Diff to previous 90790 (colored) , to selected 556936 (colored)
Add -X functionality back to httpd.

- Updates upgrading.html
- Reverts Aaron's earlier docco patch (sorry...)
- Adds -X to all mpms in the tree

Revision 90790 - (view) (annotate) - [select for diffs]
Modified Thu Aug 30 01:00:50 2001 UTC (8 years, 2 months ago) by jwoolley
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 55359 byte(s)
Diff to previous 90788 (colored) , to selected 556936 (colored)
Update the comments regarding -DONE_PROCESS and -DNO_DETACH since
-X doesn't exist anymore.

Submitted by:	Aaron Bannert

Revision 90788 - (view) (annotate) - [select for diffs]
Modified Wed Aug 29 23:17:39 2001 UTC (8 years, 2 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 55221 byte(s)
Diff to previous 90771 (colored) , to selected 556936 (colored)
Remove the declarations for variables that were moved into the core.

Revision 90771 - (view) (annotate) - [select for diffs]
Modified Tue Aug 28 18:09:36 2001 UTC (8 years, 3 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 55299 byte(s)
Diff to previous 90673 (colored) , to selected 556936 (colored)
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>

Revision 90673 - (view) (annotate) - [select for diffs]
Modified Sun Aug 26 01:24:41 2001 UTC (8 years, 3 months ago) by dougm
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 54122 byte(s)
Diff to previous 90670 (colored) , to selected 556936 (colored)
didt pay attention to the first question; pretty sure answer is no

Revision 90670 - (view) (annotate) - [select for diffs]
Modified Sun Aug 26 01:17:32 2001 UTC (8 years, 3 months ago) by dougm
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 54119 byte(s)
Diff to previous 90635 (colored) , to selected 556936 (colored)
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:

Revision 90635 - (view) (annotate) - [select for diffs]
Modified Fri Aug 24 16:49:39 2001 UTC (8 years, 3 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 54171 byte(s)
Diff to previous 90213 (colored) , to selected 556936 (colored)
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>]

Revision 90213 - (view) (annotate) - [select for diffs]
Modified Thu Aug 16 13:59:14 2001 UTC (8 years, 3 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 53411 byte(s)
Diff to previous 90153 (colored) , to selected 556936 (colored)
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

Revision 90153 - (view) (annotate) - [select for diffs]
Modified Tue Aug 14 12:30:50 2001 UTC (8 years, 3 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 52960 byte(s)
Diff to previous 90132 (colored) , to selected 556936 (colored)
namespace-protect accept_lock_mech

fix a bug in the worker MPM which effectively disabled the AcceptMutex
directive

Revision 90132 - (view) (annotate) - [select for diffs]
Modified Mon Aug 13 04:57:35 2001 UTC (8 years, 3 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 53019 byte(s)
Diff to previous 90065 (colored) , to selected 556936 (colored)
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>

Revision 90065 - (view) (annotate) - [select for diffs]
Modified Fri Aug 10 05:00:27 2001 UTC (8 years, 3 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 56896 byte(s)
Diff to previous 90064 (colored) , to selected 556936 (colored)
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.

Revision 90064 - (view) (annotate) - [select for diffs]
Modified Fri Aug 10 01:34:11 2001 UTC (8 years, 3 months ago) by gregames
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 57586 byte(s)
Diff to previous 89938 (colored) , to selected 556936 (colored)
record something in the error log if the parent process seg faults

Submitted by: Jeff Trawick

Revision 89938 - (view) (annotate) - [select for diffs]
Modified Mon Aug 6 15:55:43 2001 UTC (8 years, 3 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 56976 byte(s)
Diff to previous 89930 (colored) , to selected 556936 (colored)
Explain the worker MPM

Revision 89930 - (view) (annotate) - [select for diffs]
Modified Sun Aug 5 18:41:38 2001 UTC (8 years, 3 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 56667 byte(s)
Diff to previous 89928 (colored) , to selected 556936 (colored)
Get the worker MPM working again.  This should fix the serialization
problems, and it makes up initialize the queue only once.

Revision 89928 - (view) (annotate) - [select for diffs]
Modified Sun Aug 5 18:08:49 2001 UTC (8 years, 3 months ago) by gregames
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 56688 byte(s)
Diff to previous 89921 (colored) , to selected 556936 (colored)
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.

Revision 89921 - (view) (annotate) - [select for diffs]
Modified Sat Aug 4 11:40:16 2001 UTC (8 years, 3 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 55582 byte(s)
Diff to previous 89881 (colored) , to selected 556936 (colored)
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

Revision 89881 - (view) (annotate) - [select for diffs]
Modified Thu Aug 2 21:24:14 2001 UTC (8 years, 3 months ago) by gregames
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 55703 byte(s)
Diff to previous 89827 (colored) , to selected 556936 (colored)
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.

Revision 89827 - (view) (annotate) - [select for diffs]
Modified Tue Jul 31 15:35:28 2001 UTC (8 years, 3 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 55631 byte(s)
Diff to previous 89821 (colored) , to selected 556936 (colored)
It helps if we broadcast to the workers that we are trying to shutdown.

Revision 89821 - (view) (annotate) - [select for diffs]
Modified Tue Jul 31 06:22:32 2001 UTC (8 years, 3 months ago) by gregames
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 55517 byte(s)
Diff to previous 89817 (colored) , to selected 556936 (colored)
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.

Revision 89817 - (view) (annotate) - [select for diffs]
Modified Tue Jul 31 03:08:42 2001 UTC (8 years, 3 months ago) by gregames
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 55459 byte(s)
Diff to previous 89781 (colored) , to selected 556936 (colored)
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.

Revision 89781 - (view) (annotate) - [select for diffs]
Added Mon Jul 30 05:02:53 2001 UTC (8 years, 3 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/worker.c
File length: 55480 byte(s)
Diff to selected 556936 (colored)
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.

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

apache@apache.org
ViewVC Help
Powered by ViewVC 1.1.2