1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-08 04:22:21 +03:00
Commit Graph

77 Commits

Author SHA1 Message Date
Joe Orton
ba6d980639 * server/scoreboard.c (create_namebased_scoreboard): Use
apr_shm_remove() rather than the unsufficient apr_file_remove().

PR: 27189


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105247 13f79535-47bb-0310-9956-ffa450edef68
2004-09-22 13:35:31 +00:00
Mladen Turk
a536cfe99b Worker shared data has to be visible across all child processes,
so remove creating that data on per-child basis.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105134 13f79535-47bb-0310-9956-ffa450edef68
2004-09-15 12:08:39 +00:00
Graham Leggett
e548632412 Add load balancer support to the scoreboard in preparation for
load balancing support in mod_proxy.
PR:
Obtained from:
Submitted by:	Mladen Turk <mturk@apache.org>
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104404 13f79535-47bb-0310-9956-ffa450edef68
2004-07-28 22:50:54 +00:00
André Malo
eeb57c17ad fix name of The Apache Software Foundation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102619 13f79535-47bb-0310-9956-ffa450edef68
2004-02-09 20:40:53 +00:00
André Malo
e88fcf3c64 fix copyright dates according to the first check in
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102589 13f79535-47bb-0310-9956-ffa450edef68
2004-02-08 13:58:22 +00:00
André Malo
4f02cb1e18 apply Apache License, Version 2.0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102525 13f79535-47bb-0310-9956-ffa450edef68
2004-02-06 22:58:42 +00:00
André Malo
fb07607180 update license to 2004.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102135 13f79535-47bb-0310-9956-ffa450edef68
2004-01-01 13:26:26 +00:00
Martin Kraemer
d8f10577ef On failures, try to add a hint what went wrong
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99055 13f79535-47bb-0310-9956-ffa450edef68
2003-03-24 08:51:22 +00:00
André Malo
742af25096 finished that boring job:
update license to 2003.

Happy New Year! ;-))


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98573 13f79535-47bb-0310-9956-ffa450edef68
2003-02-03 17:53:28 +00:00
Jeff Trawick
c871b41d3c stop using APLOG_NOERRNO in calls to ap_log_?error()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95149 13f79535-47bb-0310-9956-ffa450edef68
2002-05-17 11:11:39 +00:00
Aaron Bannert
36a1c908fb Fix a potential size mismatch (apr_off_t might be 64bits on some platforms).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94430 13f79535-47bb-0310-9956-ffa450edef68
2002-04-04 06:39:22 +00:00
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