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

ServiceReference#getUsingBundles() returns usages with 0 count

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • framework-5.6.0
    • framework-5.6.2
    • Framework
    • None

    Description

      Javadoc for ServiceReference#getUsingBundles() states

      Specifically, this method returns the bundles whose usage count for that service is greater than zero.

      However, the implementation uses ServiceRegistry#getUsingBundles(ServiceReference<?> ref), which returns usages even if usage count is 0.

      The usage count is 0, because ServiceRegistry#ungetService doesn't call ServiceRegistry#flushUsageCount for non-prototype services:

      // If the registration is invalid or the usage count for a prototype
      // reached zero, then flush it. Non-prototype services are not flushed
      // on ungetService() when they reach 0 as this introduces a race
      // condition of concurrently the same service is obtained via getService()

      Expected:

      ServiceReference#getUsingBundles() doesn't return usages with 0 count

      Attachments

        1. FELIX-5485.diff
          3 kB
          Renat Sabitov

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              rsabitov Renat Sabitov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: