Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-464

Cannot retrieve service to be unbound in unbind method taking ServiceReference

    XMLWordPrintableJSON

Details

    Description

      Sometimes, the service about to be unbound needs to be retrieved from the ComponentContext if the unbind method takes the ServiceReference instead of the service object itself. In these cases, the service fails to be returned because the AbstractComponentManager.getDependencyManager(String) only returns DependencyManager instances whose size is not zero.

      This now constitutes a race condition, as the service count has already been decremented in the DependencyManager when the unbind method is called. The service itself, though, is actually still available.

      The fix is to always return any available DependencyManager regardless of the perceived size. The DependencyManager will then return the service or not dependending on whether the service is still available.

      Attachments

        Activity

          People

            fmeschbe Felix Meschberger
            fmeschbe Felix Meschberger
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: