synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "WALTON Jason" <Jason.Wal...@alcatel-lucent.com>
Subject RE: Changing configuration dynamically
Date Tue, 11 Sep 2007 15:00:20 GMT
		I'm looking to dynamically change the configuration of
Synapse while it is running

	How exactly are you planning to do this? Could you elaborate on
the proposed approach? 
	 

An excellent question!  :)  I have yet to decide on the mechanism, but
likely something similar to WSO2, with a set of web services which allow
one or more administrators to make changes to the configuration on the
fly.
 
Alternatively, updating the current "registry" based system so that all
elements, including Proxies, can be modified.  I understand, from
https://issues.apache.org/jira/browse/SYNAPSE-125, that the current
implementation would try to rebuild the entire configuration, and I
haven't dug into the code at all, but perhaps this could be modified
such that the registry reads in elements and "synchronizes" the
configuration with the registry, instead of rebuilding from scratch.


		However, digging into the implementation, I see no
indication of any form of thread synchronization in
SynapseConfiguration, nor anywhere it is referenced.  This seems to
imply that changing the configuration while running would not be thread
safe.  Am I missing the synchronization mechanism?

	Right now we have a single user model for administration from
that implementation. We will address any such issue soon as we integrate
with user management functionality in the near future
	
	

Right, so only one administrator can edit the configuration at a time;
but if we have a single configuration object shared system wide, then
while one administrator is making changes to the configuration, the
Synapse mediators could be trying to read from that configuration at the
same time.  If the administrator is adding a new proxy, for example,
this involves adding the Proxy to a HashMap in the SynapseConfiguration,
which is not thread safe, because a mediator could be trying to read
from that same HashMap while it is being modified, with undefined
results.  I was expecting to find a ReadWriteLock here, or to see the
SynapseConfiguration object which is shared be marked "volatile" and
have it cloned/modified/replaced every time a modification was made, or
something along similar lines.  I was just wondering if "something along
similar lines" exists, and I'm just missing it, or if changing the
configuration on the fly under heavy load is likely to cause chaos and
mayhem?


Mime
View raw message