[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ecf-dev] CompositeDiscoveryContainer and zoo discovery

Hi Folks,

I'm testing some new remote management services [1]...i.e. OSGi remote services for managing and OSGi runtime within Eclipse and am getting a problem that seems to be related to the CompositeDiscoveryContainer and zoodiscovery.

Specifically, when the CompositeDiscoveryContainer is active (i.e. the org.eclipse.ecf.provider.discovery bundle), and a remote service is published, the thread doing the publishing gets permanently blocked in this line of code within zoodiscovery WatchManager:

public void publish(AdvertisedService published) {
try {
/* wait for the server to get ready */
while (!writeRootLock.isOpen())
Thread.sleep(300); <--- Gets hung up here. writeRootLock.isOpen() never is opened.
} catch (InterruptedException e) {
Logger.log(LogService.LOG_DEBUG, e.getMessage(), e);

I can see from the stack trace that this publish is being called from the CompositeDiscoveryContainer (rather than via ZooDiscoveryContainer directly). If I stop the composite container bundle *before* registering the remote service (which triggers the discovery publish) then everything works fine (no hang). My suspicion is that there is something about the initialization of zoodiscovery that is causing a race, and triggering this hang, but I'm not sure.

As a work around, is it possible to disable the CompositeDiscoveryContainer...in some other way than explicitly stopping it's bundle? Another question: should we stop installing the CompositeDiscoveryContainer bundle? Also: is there some way to restrict a given remote service export to use only one discovery provider (a specific one) rather than using all active discovery providers by default? Perhaps this is an addition we should make for ECF's remote services impl. Opinions?



[1] https://github.com/ECF/OSGIRemoteManagement