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 E6F20D7E4 for ; Thu, 6 Dec 2012 01:01:20 +0000 (UTC) Received: (qmail 51717 invoked by uid 500); 6 Dec 2012 01:01:20 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 51677 invoked by uid 500); 6 Dec 2012 01:01:20 -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 51666 invoked by uid 99); 6 Dec 2012 01:01:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2012 01:01:20 +0000 Date: Thu, 6 Dec 2012 01:01:17 +0000 (UTC) From: "TangYong (JIRA)" To: dev@felix.apache.org Message-ID: <1016838999.66181.1354755680101.JavaMail.jiratomcat@arcas> In-Reply-To: <1139528523.51350.1350395224074.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (FELIX-3713) Bundle.start() returns without starting the bundle 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-3713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13510994#comment-13510994 ] TangYong commented on FELIX-3713: --------------------------------- Hi sahoo, richard, About the issue happened on glassfish, according to richard's reply, while attempting to execute "bundle.start(Bundle.START_TRANSIENT)" and the bundle is used by FelixStartLevel thread, using the following method should resolve the issue, 1) before executing "bundle.start(Bundle.START_TRANSIENT), using StartLevel.getStartLevel() to seeing whether active start level value of the Framework is equal to the value of "glassfish.osgi.start.level.final". 2) if being equal, this means that basiclly Framework Acitve StartLevel has been adjusted, and m_startLevelBundles has removed the transient bundle, then, we start to execute "bundle.start(Bundle.START_TRANSIENT). 3) if not being equal, we do a loop until active start level value of the Framework is equal to the value of "glassfish.osgi.start.level.final", then, we start to execute "bundle.start(Bundle.START_TRANSIENT). I will spend some time to validate the above. Thanks --Tang > Bundle.start() returns without starting the bundle > -------------------------------------------------- > > Key: FELIX-3713 > URL: https://issues.apache.org/jira/browse/FELIX-3713 > Project: Felix > Issue Type: Bug > Components: Framework > Affects Versions: framework-4.0.2 > Reporter: Sahoo > Fix For: framework-4.2.0 > > > See email exchange between Sahoo & Richard that happened in dev alias on 16th Oct 2012 for issue details: > > While investigating some issues in GlassFish, what we are seeing is that even if our code is calling bundle.start(START_TRANSIENT), the bundle is not getting started immediately, nor is the code blocking. It simply returns without Bundle's activator getting called and bundle.getState() == RESOLVED. We see this happening when there is a start level change in progress. We are currently using Felix 4.0.2. Looking at the code, I see this to be by design, but isn't it a non-compliant behavior? Should bundle.start() not wait until the bundle is started? > The spec has always been a little lenient about how start levels are processed to give leeway to the frameworks. For us, we viewed this as somewhat of a race condition between threads starting bundles and the start level thread. > However, in the transient case, I wouldn't expect it to remain in RESOLVED state. If its start level wasn't met, it should have thrown an exception. Yet there is a chance in the transient case that it could start asynchronously...not sure if this would really be problematic for you or not... > But it shouldn't remain in the RESOLVED state. Looking at the code, I think there is a bug in this scenario where a transient bundle that is handled asynchronously will not actually end up getting started since the start level thread checks the persistent state of the bundle, which is not set for transient bundles. > You could definitely open up a bug for this last issue... > -> richard -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira