cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "A. Rothman" <>
Subject Re: Fwd: DOSGi - service not exported consistently
Date Thu, 21 Mar 2013 20:01:20 GMT

> 3. After all the fixes above, the export success rate is definitely 
> better than 50%, but still isn't 100% - every once in a while the 
> export still fails. Looking through the logs, I found the message 
> "RemoteServiceAdmin Implementation is shutting down now" - during 
> Karaf startup! I'm still not sure what exactly is going on, but it 
> appears that the RSA is started, services exported properly etc., but 
> then it suddenly commits suicide a few moments later with no other 
> error or indication of who/what initiated the shutdown or why. The 
> initial theory is that the dsw Activator might be getting a 
> ConfigurationAdmin updated event with null configuration, which would 
> trigger a shutdown - but I haven't yet confirmed that this is the 
> case, nor why it would happen or what the proper behavior in such a 
> case should be.
Following up on this, the config updated callback was indeed the 
problem. There's also a race condition in the class that can cause 
trouble, and an endless loop bug when the configuration does change... 
attached is a fix for the issues I've found - again, I'm new to all 
this, so please correct anything I've missed.

These are the changes:

- separated stop/start (when bundle is started or stopped) from 
init/uninit (setting up/tearing down the services when configuration 
changes) - solves endless loop caused by start re-registering managed 
service, which re-triggers update, which calls start etc. ad infinitum
- synchronized init/uninit/update (since update is called from another 
thread and so init/uninit may be called concurrently with undefined results
- fixed updated callback shutting down service right after it starts 
(when config is null), causing service exports to fail sometimes
- added proper unregistering of managed service
- added a few debug logs to help follow the sequence of events

Also, if there's anything else I should do to get these patches accepted 
and committed for the next release, please let me know!

Sometime between 1.4 and 1.5-SNAPSHOT it appears the default exported 
service urls (with -> without "cxf" prefix) and ports (8181 -> 9000) 
have changed - is this on purpose? Actually, there are two different 
default configurations in two different places, HttpServiceManager and 
Pojo something, and now one of them is used instead of the other. 
Perhaps they should be rearranged to make it clear how and when each is 

View raw message