You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jim Jagielski <ji...@jaguNET.com> on 1996/09/04 22:18:18 UTC
For consideration
Here's a patchlet that fixes bug in which, using file-based-scoreboard,
things can get out of sync. Basically, before we use the scoreboard
array, sync it with the scoreboard file... This is key with
update_child_status and increment_count.
Unless there are problems, I will commit in a few days:
Index: apache/src/http_main.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_main.c,v
retrieving revision 1.63
diff -c -r1.63 http_main.c
*** http_main.c 1996/08/23 18:19:11 1.63
--- http_main.c 1996/09/04 20:15:17
***************
*** 753,763 ****
int update_child_status (int child_num, int status, request_rec *r)
{
int old_status;
! short_score new_score_rec=scoreboard_image->servers[child_num];
if (child_num < 0)
return -1;
new_score_rec.pid = getpid();
old_status = new_score_rec.status;
new_score_rec.status = status;
--- 753,765 ----
int update_child_status (int child_num, int status, request_rec *r)
{
int old_status;
! short_score new_score_rec;
if (child_num < 0)
return -1;
+ sync_scoreboard_image();
+ new_score_rec = scoreboard_image->servers[child_num];
new_score_rec.pid = getpid();
old_status = new_score_rec.status;
new_score_rec.status = status;
***************
*** 852,859 ****
{
long int bs=0;
time_t now;
! short_score new_score_rec=scoreboard_image->servers[child_num];
if (r->sent_bodyct)
bgetopt(r->connection->client, BO_BYTECT, &bs);
--- 854,863 ----
{
long int bs=0;
time_t now;
! short_score new_score_rec;
+ sync_scoreboard_image();
+ new_score_rec = scoreboard_image->servers[child_num];
if (r->sent_bodyct)
bgetopt(r->connection->client, BO_BYTECT, &bs);
***************
*** 959,965 ****
&& waitpid(scoreboard_image->servers[n].pid,&status,WNOHANG) == -1
&& errno == ECHILD)
{
- sync_scoreboard_image();
update_child_status(n,SERVER_DEAD,NULL);
}
}
--- 963,968 ----
--
Jim Jagielski << jim@jaguNET.com >> | "There is a time for laughing,
** jaguNET Access Services ** | and a time for not laughing,
Email: info@jaguNET.com | and this is not one of them"
++ http://www.jaguNET.com/ +++ Voice/Fax: 410-931-3157 ++