httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: scoreboard bug
Date Mon, 30 Nov 1998 18:06:22 GMT


On Mon, 30 Nov 1998, Harrie Hazewinkel wrote:

> Dean Gaudet wrote:
> > 
> > After a graceful restart, the vhost pointer in requests belong to children
> > of the previous generation is bogus... this is an unfortunate side-effect
> > of the vhost name -> ptr change made recently.
> 
> I believe someone else mentioned this already a long time ago as well,
> but that was with the old vhost name as a string in the scoreboard.
> How was it fixed then??

No it wasn't a problem then.  The vhost string would always be valid since
it was stored entirely in the scoreboard (assuming you don't hit the race
condition where it's being copied in...) 

The problem is that across a graceful restart, the new children (the ones
serving the status request) don't share the same memory map as the
gracefully exiting children.  So the server_rec pointer is bogus. 

Across a non-graceful restart this isn't an issue because a new scoreboard
is created (and the old children are killed off before any new children
are spawned).

> > A solution that works for both on-disk and in-memory scoreboards is to
> > record each child's generation in the scoreboard (when the child is
> > created).  Then mod_status can skip the vhost field for any child whose
> > generation is not the same as its own.
> 
> Could we not use the 'child_exit' function of the 'mod_status'
> for this. Otherwise a check for each request is required
> to see if the mod_status can skip the vhost field.

No, because the old children don't exit immediately, that's the point of
graceful restart.

For in-memory scoreboards it's sufficient to test for the SERVER_GRACEFUL
state, which is cheaper... but we don't set any children to that state in
on-disk scoreboards, because on-disk scoreboards don't allow us to
reliably write that field. 

But this is mod_status we're talking about, why do you think the extra
memory load and integer comparison is a big problem?  The test is only
required for each mod_status request... not every request to the server... 

Dean



Mime
View raw message