You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 1998/11/30 15:21:47 UTC

scoreboard bug

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. 

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.

Dean



Re: scoreboard bug

Posted by Harrie Hazewinkel <ha...@jrc.it>.
Dean Gaudet wrote:
[snip]
> 
> 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...

Aahh, you are right here. I was thinking differently.

-- 
0- Harrie Hazewinkel --------------------------------------0
 mailto:harrie.hazewinkel@jrc.it       phone:+39+0332786322
 http://operations.ceo.org/~harrie/      fax:+39+0332785641
 postal: JRC of the E.C.  -       -  Ispra 21020 (VA) Italy
0----------------------------------------------------------0

Re: scoreboard bug

Posted by Dean Gaudet <dg...@arctic.org>.

On Mon, 30 Nov 1998, Dean Gaudet wrote:

> 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. 

duh, I'm wrong here though.  A slot goes from SERVER_GRACEFUL to
SERVER_DEAD ... and if we were only testing the state we'd also have to
ignore all the SERVER_DEAD vhosts as well. 

Dean


Re: scoreboard bug

Posted by Dean Gaudet <dg...@arctic.org>.

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



Re: scoreboard bug

Posted by Harrie Hazewinkel <ha...@jrc.it>.
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??

> 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.

0- Harrie Hazewinkel --------------------------------------0
 mailto:harrie.hazewinkel@jrc.it       phone:+39+0332786322
 http://operations.ceo.org/~harrie/      fax:+39+0332785641
 postal: JRC of the E.C.  -       -  Ispra 21020 (VA) Italy
0----------------------------------------------------------0