
|
If you were logged in you would be able to see more operations.
|
|
|
| Resolution Date: |
10/Jun/08 08:40 AM
|
|
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.
|
|
Description
|
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. |
Show » |
|
- 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.