Uploaded image for project: 'CXF Distributed OSGi (Retired)'
  1. CXF Distributed OSGi (Retired)
  2. DOSGI-198

Imported service is gone after client bundle is restarted

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.0
    • 1.6.0
    • common
    • None
    • Unknown

    Description

      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.

      Attachments

        Activity

          People

            amichai Amichai Rothman
            amichai Amichai Rothman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: