Return-Path: Delivered-To: apache-cvs-archive@hyperreal.org Received: (qmail 7187 invoked by uid 6000); 10 Dec 1998 15:14:13 -0000 Received: (qmail 7175 invoked by alias); 10 Dec 1998 15:14:11 -0000 Delivered-To: apache-1.3-cvs@hyperreal.org Received: (qmail 7172 invoked by uid 125); 10 Dec 1998 15:14:10 -0000 Date: 10 Dec 1998 15:14:10 -0000 Message-ID: <19981210151410.7171.qmail@hyperreal.org> From: jim@hyperreal.org To: apache-1.3-cvs@hyperreal.org Subject: cvs commit: apache-1.3/src/main http_main.c Sender: apache-cvs-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org jim 98/12/10 07:14:10 Modified: src/main http_main.c Log: Add 'reset slot vhost' logic to the ap_update_child_status function and avoid the race as well. Revision Changes Path 1.409 +11 -9 apache-1.3/src/main/http_main.c Index: http_main.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v retrieving revision 1.408 retrieving revision 1.409 diff -u -r1.408 -r1.409 --- http_main.c 1998/12/04 19:12:16 1.408 +++ http_main.c 1998/12/10 15:14:08 1.409 @@ -2069,6 +2069,17 @@ sizeof(ss->request)); } ss->vhostrec = r->server; + } else if (status == SERVER_STARTING) { + /* clean up the slot's vhostrec pointer (maybe re-used) + * and mark the slot as belonging to a new generation. + */ + ss->vhostrec = NULL; + ap_scoreboard_image->parent[child_num].generation = ap_my_generation; +#ifdef SCOREBOARD_FILE + lseek(scoreboard_fd, XtOffsetOf(scoreboard, parent[child_num]), 0); + force_write(scoreboard_fd, &ap_scoreboard_image->parent[child_num], + sizeof(parent_score)); +#endif } } put_scoreboard_info(child_num, ss); @@ -3917,15 +3928,6 @@ Explain1("Starting new child in slot %d", slot); (void) ap_update_child_status(slot, SERVER_STARTING, (request_rec *) NULL); - /* clean up the slot's vhostrec pointer now that it is being re-used, - * and mark the slot as beloging to a new generation. - */ - /* XXX: there's still a race condition here for file-based scoreboards... - * but... like, do we really care to spend yet another write() operation - * here? -djg - */ - ap_scoreboard_image->servers[slot].vhostrec = NULL; - ap_scoreboard_image->parent[slot].generation = ap_my_generation; #ifndef _OSD_POSIX if ((pid = fork()) == -1) {