Uploaded image for project: 'mdsal'
  1. mdsal
  2. MDSAL-234

Cluster singleton service unable to handle closeServiceInstance() being called from instantiateServiceInstance()

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Duplicate
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 7855

    Description

      While implementing CONTROLLER-1601 we have noticed that singleton service provider is unable to handle this due to the way it's internal locking is implemented.

      As it stands now if you actually call closeServiceInstance() from InstantiateServiceInstance() or vice versa you will deadlock the singleton thread since it's waiting for a permit on the semaphore that will never be released.
      Changing the semaphore to a reentrant lock would not help since instead you would run into an infinite recursion from close() -> instantiate() -> close() -> etc..

      Possible solution might be to have an singleThreaded ExecutorService inside SingletonService Provider and to proxy the calls interacting with it through the executor.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Unassigned Unassigned
              tcere Tomas Cere
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: