1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-05 05:30:39 +03:00
Commit Graph

116 Commits

Author SHA1 Message Date
Jim Jagielski
70bb2575ea 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:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94306 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 14:33:50 +00:00
Jeff Trawick
d94b9f34d6 ap_create_scoreboard() now initializes the scoreboard if it already exists,
so MPMs shouldn't call it for a graceful restart


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94060 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 20:30:46 +00:00
William A. Rowe Jr
6e8a873d8c The source of some ills ... there is no reason to keep going if the
scoreboard exists.  I suspect this should be a general cleanup as well
  [at the end of ap_create_scoreboard.]  But calling ap_run_pre_mpm with
  the process->pool should take care of a clobbered scoreboard shm on
  graceful restart.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94040 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 06:04:51 +00:00
William A. Rowe Jr
65a37752ec Eliminate potential ap_server_root_relative segfaults, with the input
of Jeff Trawick's style changes to the first patches.  Doesn't include
  the fixes to ssl [more complex], and we won't trap errors that involve
  ap_serverroot, since we presume that was normalized on the way in.
  Therefore, testing ap_server_root_relative(DEFAULT_FOO) cases
  should never become necessary.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93965 13f79535-47bb-0310-9956-ffa450edef68
2002-03-16 18:26:58 +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
Jeff Trawick
d86a35b7e5 Fix the calculation of thread_num in the worker score structure.
Submitted by:   Stas Bekman
Reviewed by:    Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93900 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 12:25:31 +00:00
Doug MacEachern
4cdb6b8dec ap_calc_scoreboard_size() needs to be exported for win32
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93590 13f79535-47bb-0310-9956-ffa450edef68
2002-02-27 04:10:19 +00:00
Cliff Woolley
03001bc176 remove a tab
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93563 13f79535-47bb-0310-9956-ffa450edef68
2002-02-25 02:10:52 +00:00
Aaron Bannert
d2fe7ba429 Placing the thread-limit and server-limit values, those which define the
size of internal structures in the scoreboard, actually into the
scoreboard allow third-party applications to access those structures.

Submitted by:	Adam Sussman <myddryn@vishnu.vidya.com>
Reviewed by:	Aaron Bannert


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93523 13f79535-47bb-0310-9956-ffa450edef68
2002-02-21 01:30:06 +00:00
Bill Stoddard
b1e828a3bf This fixes a bug in mod_status on Windows where restart time was not
properly initialized.

Move ap_restart_time into the scoreboard global area so the child process
on non-forking platforms can have access to it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93502 13f79535-47bb-0310-9956-ffa450edef68
2002-02-19 21:09:27 +00:00
Aaron Bannert
0cff6e8f58 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93434 13f79535-47bb-0310-9956-ffa450edef68
2002-02-15 20:48:19 +00:00
Bradley Nicholes
5f4457ace3 Moved the #endif of APR_HAS_SHARED_MEMORY to include a reference
to the global variable ap_scoreboard_shm.  Since this variable was already
being excluded by APR_HAS_SHARED_MEMORY at the beginning of the
file.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93166 13f79535-47bb-0310-9956-ffa450edef68
2002-02-01 18:07:08 +00:00
Aaron Bannert
fab935b87c Create the scoreboard (in the parent) in a global pool context, so it
survives graceful restarts. This fixes a SEGV during graceful restarts.

Children who attach to this scoreboard keep the same pool as before (pchild)
since they should detach/unmap when the child process exits.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93159 13f79535-47bb-0310-9956-ffa450edef68
2002-02-01 17:22:57 +00:00
Ryan Bloom
5cd5470300 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93119 13f79535-47bb-0310-9956-ffa450edef68
2002-01-30 22:35:57 +00:00
Jeff Trawick
7c1ce28ee1 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93055 13f79535-47bb-0310-9956-ffa450edef68
2002-01-28 00:41:32 +00:00
Jeff Trawick
7a0f1357d6 axe an unused variable
don't pass uninitialized rv to ap_log_error as the error code


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93028 13f79535-47bb-0310-9956-ffa450edef68
2002-01-25 12:04:56 +00:00
William A. Rowe Jr
2b87916666 No. I don't like this patch. I like what it does [shared scoreboard
for Windows, finally] but not how it's implemented.

  However it works, and is equally crufty to what already exists for
  win32 listeners and other exposed data within scoreboard.c.

  To do this right, we need to drop all the external references to data
  within the scoreboard, and add an accessor for remaining bits (such as
  Win32's need for direct access to the apr_shm_t.)  And within Win32,
  we need to stack all this _within_ the pre-mpm hook.  But those are
  missions in and of themselves.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93027 13f79535-47bb-0310-9956-ffa450edef68
2002-01-25 07:21:40 +00:00
William A. Rowe Jr
7c93a08860 A quick hack around Aaron's patch. Win32 'supports' anon shm, but
Apache's implementation requires fork().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92996 13f79535-47bb-0310-9956-ffa450edef68
2002-01-24 07:47:10 +00:00
Aaron Bannert
f5ebd68963 Just a style update before I work on this thing any more. Removed
tabs and lined up parameters and indentation.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92981 13f79535-47bb-0310-9956-ffa450edef68
2002-01-23 18:11:40 +00:00
Aaron Bannert
91c3d33fb0 Although this patch is technically correct, I'm not happy with
the way it gets things done. OTOH, it is a simple enough change
to get things working correctly for now. I will come up with
the right way to do this in the next couple days.

This patch re-enables the use of anonymous shared memory in the
scoreboard on platforms that have it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92978 13f79535-47bb-0310-9956-ffa450edef68
2002-01-23 06:51:18 +00:00
Bradley Nicholes
4d2424f811 Added APR_HAS_SHARED_MEMORY to a section of code where it was
missing, for those of us that don't have shared memory support.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92854 13f79535-47bb-0310-9956-ffa450edef68
2002-01-14 22:36:03 +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
a329ff6cf9 Make calc_scoreboard_size() and init_scoreboard() usable from MPMs.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92661 13f79535-47bb-0310-9956-ffa450edef68
2001-12-30 13:27:48 +00:00
Jeff Trawick
cadc4d09a0 fix a horrible bug which caused scoreboard initialation to always exit
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92595 13f79535-47bb-0310-9956-ffa450edef68
2001-12-24 21:00:18 +00:00
Jeff Trawick
873a027b86 The scoreboard is no longer created while we can write to
stderr, so call ap_log_error() to note problems allocating
the scoreboard.

apr_shm_malloc() doesn't set any kind of error code, so don't
try to reference errno.

setup_shared() now returns an error code to its caller rather
than exiting directly.  This isn't a complete fix, as
ap_create_scoreboard() needs to do the same thing.  Currently,
when we can't allocate the scoreboard we leave the mod_cgid
daemon process stranded.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92592 13f79535-47bb-0310-9956-ffa450edef68
2001-12-24 13:18:44 +00:00
William A. Rowe Jr
473bf5e057 Clean up a compiler emit for signedness
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92564 13f79535-47bb-0310-9956-ffa450edef68
2001-12-21 15:20:20 +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
Aaron Bannert
229c5302cd Provide an accessor function for the global_score portion of the scoreboard.
Submitted by:	Harrie Hazewinkel <harrie@covalent.net>
Reviewed by:	Aaron Bannert


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92377 13f79535-47bb-0310-9956-ffa450edef68
2001-12-07 19:08:50 +00:00
Aaron Bannert
889ecbb03a Export ap_get_parent_scoreboard and ap_get_servers_scoreboard to be
usable on Win32 and friends.

Submitted by:	Harrie Hazewinkel <harrie@covalent.net>
Reviewed by:	Aaron Bannert


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92375 13f79535-47bb-0310-9956-ffa450edef68
2001-12-07 19:06:29 +00:00
Greg Ames
a3ffd0cfd0 prevent seg faults in mod_status trying to access vhost structures from
the former generation, after a restart.  It happens mostly when the MPM has
threads.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91667 13f79535-47bb-0310-9956-ffa450edef68
2001-10-26 15:40:04 +00:00
Jeff Trawick
938bf4075b when we bail out due to a fatal error in apr_shm_init(), be sure
to print the apr_status_t in numeric form

the old message

lt-httpd: could not open(create) scoreboard: Unknown resolver error

wasn't so useful, but the new, improved message

lt-httpd: could not open(create) scoreboard: (22528)Unknown resolver error

makes it look like a syscall is returning ENOSPC and that apr shmem
is returning (APR_OS_START_SYSERR + errno) instead of simply errno.

off to APR land...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90814 13f79535-47bb-0310-9956-ffa450edef68
2001-08-30 15:44:13 +00:00
Doug MacEachern
2090fa8748 adjust to apr_uri_ rename
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90361 13f79535-47bb-0310-9956-ffa450edef68
2001-08-19 16:01:05 +00:00
Doug MacEachern
d40f9b24be adjust to UNP_ -> APR_URI_UNP_ rename
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90359 13f79535-47bb-0310-9956-ffa450edef68
2001-08-19 15:52:59 +00:00
Greg Ames
a2f4e88595 clean up the scoreboard properly after threaded processes die gracefully.
find_child_by_pid() failed to do its job, because ap_max_daemons_used was
too low.  There was some recent breakage in threaded that contributes to
the problem.

However, find_child_by_pid() should not be using the current number of
daemons.  It could have been recently reduced, which makes it fail to
find the exiting process.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90015 13f79535-47bb-0310-9956-ffa450edef68
2001-08-07 22:28:51 +00:00
William A. Rowe Jr
34e5481650 Exported symbols for mod_pop
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89842 13f79535-47bb-0310-9956-ffa450edef68
2001-07-31 20:46:06 +00:00
Greg Ames
eca0a9cd55 prevent seg faults in mod_status with ExtendedStatus enabled, after
a restart.  A pointer to the previous generation's vhost server_rec
could be left in the worker_score under certain conditions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89660 13f79535-47bb-0310-9956-ffa450edef68
2001-07-23 18:17:16 +00:00
William A. Rowe Jr
7f30a1383e Fix ap_create_scoreboard fooness on Win32.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89609 13f79535-47bb-0310-9956-ffa450edef68
2001-07-18 21:13:04 +00:00
Ryan Bloom
3d8f3ce64b Make scoreboard creation a hook. This allows management
modules to have access to the scoreboard at the time that it is
created, and at every restart request.
Submitted by:	Cody Sherr <csherr@covalent.net>
Reviewed by:	Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89608 13f79535-47bb-0310-9956-ffa450edef68
2001-07-18 20:45:36 +00:00
Paul J. Reder
620a48e609 Changed AP_MPMQ_MAX_DAEMONS to refer to MaxClients and
added an AP_MPMQ_MAX_DAEMON_USED to refer to the highest
daemon index actually used in the scoreboard. I also
updated the pertinent calls.

Paul J. Reder


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89604 13f79535-47bb-0310-9956-ffa450edef68
2001-07-18 20:29:00 +00:00
Ryan Bloom
6a04393470 Remove a couple fields from the scoreboard that aren't currently used.
If we need these, they should be added when we begin to use them.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89554 13f79535-47bb-0310-9956-ffa450edef68
2001-07-16 02:29:33 +00:00
Greg Ames
5139e492bd scratch an old itch - give lingering close its own state in the scoreboard.
clean up SERVER_ACCEPTING and SERVER_QUEUEING (never set) while I'm at it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89542 13f79535-47bb-0310-9956-ffa450edef68
2001-07-12 03:20:50 +00:00
Ryan Bloom
2843b8672e Add two functions to allow modules to access random parts of the
scoreboard.  This allows modules compiled for one MPM to access the
scoreboard, even if it the server was compiled for another MPM.

Submitted by:	Harrie Hazewinkel <harrie@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89532 13f79535-47bb-0310-9956-ffa450edef68
2001-07-10 19:00:03 +00:00
Roy T. Fielding
43b9634ceb Moved util_uri to apr-util/uri/apr_uri, which means adding the apr_
prefix to all of the uri functions (yuck), changing some includes,
and using APR error codes instead of HTTP-specific error codes.

Other notes to test this patch:
- You need to delete the util_uri.h file - exports picks up on this.
- I'd like to remove the apr_uri.h from httpd.h, but that might
  increase the complexity of this patch even further.  Once this patch
  is accepted (in some form), then I can focus on removing apr_uri.h
  from httpd.h entirely.  I need baby steps (heh) right now.
- I imagine that this might break a bunch of stuff in Win32 or other OS
  builds with foreign dependency files.  Any help here is appreciated.

This is a start...  -- justin

Submitted by:	Justin Erenkrantz
Reviewed by:	Roy Fielding


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89198 13f79535-47bb-0310-9956-ffa450edef68
2001-05-22 01:31:12 +00:00
Paul J. Reder
1b2262dd30 Make first phase changes to the scoreboard data structures in
preparation for the rewriting of the scoreboard per my posted
design notes. [Paul J. Reder]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89115 13f79535-47bb-0310-9956-ffa450edef68
2001-05-15 02:38:17 +00:00
Jeff Trawick
5112dac930 fix some generation logic/displays in mod_status by setting
the generation field in parent_score


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89050 13f79535-47bb-0310-9956-ffa450edef68
2001-05-07 17:55:01 +00:00
Jeff Trawick
e4fad412b8 minor scoreboard/status improvements:
. get the SS field in extended status output formatted correctly
  (seconds since beginning of request shouldn't be a huge
  negative number :) )
. use APR_OS_PID_T_FMT and pid_t where appropriate in mod_status
  to avoid casting, some of which may have been broken on some
  architectures


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89048 13f79535-47bb-0310-9956-ffa450edef68
2001-05-07 16:24:14 +00:00
Jeff Trawick
d3dcba691d tweak ap_get_remote_host() so that the caller can find out if she got
back an IP address

mod_access needed to know this, but the old code didn't handle IPv6


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88484 13f79535-47bb-0310-9956-ffa450edef68
2001-03-09 20:30:34 +00:00
Ryan Bloom
d2d23882af Allow modules to query the MPM about it's execution profile. This
query API can and should be extended in the future, but for now,
max_daemons, and threading or forking is a very good start.

Non-Unix MPM's do have the MPM query function, although there is no
garauntee that the information is perfect, please check.

Submitted by:	Jon Travis <jtravis@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88437 13f79535-47bb-0310-9956-ffa450edef68
2001-03-02 22:46:33 +00:00
Greg Stein
ee3fe477e3 *) fix inline handling. we had: apr_inline, APR_INLINE, USE_GNU_INLINE, and
INLINE. Now, we just have APR_INLINE and APR_HAS_INLINE.
   - convert all usage
   - note that apr_general messed up the defn (compared to apr.h)
   - simplify the inline decision logic in os/*/os.h
   - simplify the code in os/*/os-inline.c

*) toss ap_checkconv() [no longer used]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88298 13f79535-47bb-0310-9956-ffa450edef68
2001-02-24 11:23:31 +00:00
Roy T. Fielding
381f88d56a Update copyright to 2001
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88184 13f79535-47bb-0310-9956-ffa450edef68
2001-02-16 04:26:53 +00:00