[
https://issues.apache.org/jira/browse/FELIX-4977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
David Bosschaert resolved FELIX-4977.
-------------------------------------
Resolution: Fixed
With the following commits, the sporadic test failure of
ServiceRegistryTest.testGetUngetServiceFactory() have been resolved:
http://svn.apache.org/viewvc?view=revision&revision=1693602
http://svn.apache.org/viewvc?view=revision&revision=1693609
http://svn.apache.org/viewvc?view=revision&revision=1693612
> Concurrency issue with factory services
> ---------------------------------------
>
> Key: FELIX-4977
> URL: https://issues.apache.org/jira/browse/FELIX-4977
> Project: Felix
> Issue Type: Bug
> Components: Framework
> Affects Versions: framework-5.0.1
> Reporter: Carsten Ziegeler
> Assignee: David Bosschaert
> Fix For: framework-5.0.2
>
>
> It seems there is a chance that a service object returned for a factory
> service is already unget. The scenario is like this:
> Two threads from the same bundle get the same service which happens to be a
> service factory.
> While the first thread calls already ungetService, the second thread is in
> the getService method. The second service gets the same object as the first
> one, but as the first one passed "successfully" through ungetService, the
> object is unget and - depending on how its implemented - not usable anymore.
> After some analysis together with David, it seems that both threads get the
> same usage count object, the ungetService thread decreases the count to zero
> before the getService thread increases it.
> Therefore the service object is unget but at the same returned to the next
> client
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)