Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7CFD71863B for ; Fri, 31 Jul 2015 14:42:05 +0000 (UTC) Received: (qmail 27607 invoked by uid 500); 31 Jul 2015 14:42:05 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 27515 invoked by uid 500); 31 Jul 2015 14:42:04 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 27218 invoked by uid 99); 31 Jul 2015 14:42:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jul 2015 14:42:04 +0000 Date: Fri, 31 Jul 2015 14:42:04 +0000 (UTC) From: "David Bosschaert (JIRA)" To: dev@felix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (FELIX-4977) Concurrency issue with factory services MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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)