[MDSAL-234] Cluster singleton service unable to handle closeServiceInstance() being called from instantiateServiceInstance() Created: 27/Feb/17  Updated: 09/Mar/18  Resolved: 19/Sep/17

Status: Resolved
Project: mdsal
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Tomas Cere Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Duplicate
duplicates MDSAL-275 VerifyException from flapping service... Resolved
External issue ID: 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.



 Comments   
Comment by Viera Zelcamova [ 31/Mar/17 ]

Correct type is improvement of existing code, therefore moving post carbon

Comment by Robert Varga [ 11/Sep/17 ]

Fixed as part of MDSAL-275.

Generated at Wed Feb 07 20:09:10 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.