[PATCH] dynamic providers

Jeff Darcy jdarcy at redhat.com
Fri Dec 17 21:45:20 UTC 2010


On 12/17/2010 02:51 PM, Jim Meyering wrote:
> I've included below a 7-cset series that allows providers to be added
> and removed dynamically.  This shows you what the interface will look
> like.

I've looked at the code a bit; here are the first few things that I noticed.

(1) The lack of locking around provider addition and (especially)
deletion is a deal-breaker.  I see that we have a refcnt field on
providers, but it's never updated for requests that use it so the checks
for it in proxy_delete_prov are meaningless.  Without that the code
simply isn't safe.  I don't think the code uses any of the provider
fields after a back-end request is initiated, so we might not need to
wait for those to complete, but

	(a) trying to guarantee that for every library to which we pass those
	fields, forever, is questionable from a maintenance POV;

	(b) that still leaves us vulnerable to initiation-phase conflicts with
	other threads;

	(c) queued replication jobs will make that even more complicated.

(2) I don't particularly care, but the RESTafarians might prefer PUT to
_primary instead of PUT to _set_primary.

(3) The shadowing of main_prov between local and module-global variables
is bad for maintainability, even when the module-global is static in
another compilation unit.


More information about the iwhd-devel mailing list