Issue Details (XML | Word | Printable)

Key: FELIX-599
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Felix Meschberger
Reporter: Felix Meschberger
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Felix

Service Registration Lock: Do not release not-owned lock and don't wait so long for the lock

Created: 06/Jun/08 01:10 PM   Updated: 10/Jun/08 08:40 AM
Return to search
Component/s: Declarative Services (SCR)
Affects Version/s: scr-1.0.2
Fix Version/s: scr-1.0.2

Time Tracking:
Not Specified

Resolution Date: 10/Jun/08 08:40 AM


 Description  « Hide
While fixing a asynchronicity issue in the AbstractComponentManager class, I introduced a locking mechanism for the service registration field. This implementation has two issues:

(1) The unlockServiceRegistration lock simply releases the lock regardless of who is calling the method. This causes wrong threads to be able to release the lock of other threads. A secondary to this issue is, that the unlockServiceRegistration method is called by the getServiceReference() and unregisterComponentService methods, regardless of whether the lock could be acquired or not.

(2) When trying to acquire the lock, the lockServiceRegistration method tries to acquire the lock and if not possible waits for 10 * 10 seconds (at most) until giving up. This is probably too much. If the lock cannot be acquired within a short time frame, chances are, the lock will never be acquirable. Therefore, this time frame is cut down to 10 * 1 second before failing.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Felix Meschberger added a comment - 06/Jun/08 01:22 PM
Mutliple changes to service registration locking:
- only log once (at info level) when waiting for the lock release
- wait at most 10 * 1 seconds
- unlock only allowed for the lock owner
- prevent calling the unlock method if lock acquisition failed

Fixed in Rev. 663930.

Felix Meschberger added a comment - 10/Jun/08 08:40 AM
This has been implemented and can be closed.