Amichai Rothman created DOSGI-198:
-------------------------------------
Summary: Imported service is gone after client bundle is restarted
Key: DOSGI-198
URL: https://issues.apache.org/jira/browse/DOSGI-198
Project: CXF Distributed OSGi
Issue Type: Bug
Components: Discovery
Affects Versions: 1.6.0
Reporter: Amichai Rothman
Assignee: Amichai Rothman
When a local bundle uses a remote (imported) service using ZooKeeper discovery,
and the local bundle is restarted, the imported service may no longer be
available (until the remote service bundle is also restarted).
This may occur inconsistently due to a race condition - I've managed to
recreate it in a debugger such that whenever I stop at some breakpoint in
TopologyManagerImport for a few seconds the service is re-imported properly,
but when I let it run without stalling at a breakpoint it is never imported
after the bundle restart.
After much investigation the root cause was found to be in the ZooKeeper
discovery's InterfaceMonitorManager, which does not properly notify modified
EndpointListeners of pre-discovered endpoints. When the client bundle is
restarted, the TopologyManagerImport (which is an EndpointListener) service
properties are modified to reflect the changing interest scope (reduce followed
by expand of requested remote service), but due to said bug it will not receive
a notification about the previously-known remote service endpoint. Since the
TMI's actual un-export/re-import is done in a separate thread, there is a race
condition of whether or not the endpoint will be known at the time of import,
and thus it will sometimes not be re-imported.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira