On Tuesday 14 February 2006 15:06, Jim Jagielski wrote:
> Off the top of my head, I have no idea why we even have lb_score

Neither have I.  Someone slipped it it; noone objected.

> rather than just using proxy_worker_stat as we should.
> This is easy to fix except for the fact that ap_get_scoreboard_lb()
> is AP_DECLARE... Of course, adjusting in HEAD is fine, but
> this is something that really should be fixed in 2.2, which
> means we have an API change.

-1 for 2.2.  Provisionally +1 for 2.4.

> Comments?

This came up just yesterday on IRC.  Brian would like to be able
to allocate some scoreboard space for his module.  Metoo.

I haven't thought this through yet, but presumably we could implement
an API for this.  Something like:

struct worker_score {
  /* all the stuff that's there now */
  void data[];   /* at the end */
};
/* ditto other records */

and an enum
enum { AP_SCOREBOARD_[GLOBAL|PROCESS|WORKER] ;} scoreboard_access_t;

then AP functions to allocate data bytes in a pre_mpm hook
with APR_HOOK_FIRST:
  void ap_scoreboard_alloc_space(module* key, size_t nbytes, our enum);

and to retrieve them anywhere:
  void* ap_scoreboard_get_data(module* key, our enum);

Then all we need is a table of offsets by module, to be set up before
the scoreboard is allocated and added in scoreboard_size,
scoreboard_init and accessors.

That leaves loadbalancers a proper API for attaching to the scoreboard,
and opens it to other modules.

-- 
Nick Kew

Reply via email to