On Fri, Jan 18, 2002 at 05:48:12PM -0500, Greg Ames wrote:
> since we have a potential fix for the load spikes and the traffic was light, I
> tried bouncing the httpd server over to a build from current HEAD with a patched
> prefork. Much to my surprise, I got:
>
> [Fri Jan 18 14:09:25 2002] [crit] (22)Invalid argument: Fatal error: could not
> open(create) scoreboard
>
> ...so the site was down for about a minute.
>
> Any ideas? I'm way behind on e-mail, so my apologies if I haven't seen
> something relevant.
This patch gets us to use anonymous shared memory on platforms that
have it. I've tested it on daedalus.
I'm not happy about it doing a runtime check to see if anonymous shared
memory works (and then falling back to name-based shmem), but this
should work until I come up with a better way to handle the differences
in parent/child inheritance between the different platforms. I'll try
to do this tonight, but this should keep us going for now.
(Keep in mind that name-based shmem is incomplete on Unix, while anonymous
shmem has been tested extensively across many Unix platforms.)
-aaron
Index: server/scoreboard.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/scoreboard.c,v
retrieving revision 1.46
diff -u -u -r1.46 scoreboard.c
--- server/scoreboard.c 14 Jan 2002 22:36:03 -0000 1.46
+++ server/scoreboard.c 19 Jan 2002 01:42:39 -0000
@@ -164,14 +164,23 @@
apr_status_t rv;
char *fname = NULL;
- if (ap_scoreboard_fname) {
- fname = ap_server_root_relative(p, ap_scoreboard_fname);
- }
rv = apr_shm_create(&scoreboard_shm, scoreboard_size, fname, p);
- if (rv != APR_SUCCESS) {
+ if ((rv != APR_SUCCESS) && (rv != APR_ENOTIMPL)) {
ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
- "Fatal error: could not open(create) scoreboard");
+ "Fatal error: could not create scoreboard "
+ "(using anonymous shared memory)");
return rv;
+ }
+ if (rv == APR_ENOTIMPL) {
+ if (ap_scoreboard_fname) {
+ fname = ap_server_root_relative(p, ap_scoreboard_fname);
+ }
+ rv = apr_shm_create(&scoreboard_shm, scoreboard_size, fname, p);
+ if (rv != APR_SUCCESS) {
+ ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL,
+ "Fatal error: could not open(create) scoreboard");
+ return rv;
+ }
}
/* everything will be cleared shortly */
#endif