metatech created FELIX-4527:
-------------------------------

             Summary: Infinite loop when bundle is undeployed "coldly" (when 
container is stopped)
                 Key: FELIX-4527
                 URL: https://issues.apache.org/jira/browse/FELIX-4527
             Project: Felix
          Issue Type: Bug
          Components: Framework
    Affects Versions: framework-3.2.2
         Environment: ServiceMix 4.5.3
            Reporter: metatech


When a bundle is undeployed when ServiceMix is stopped, on the next restart the 
FelixStartLevel thread enters an infinite loop.
{code}
"FelixStartLevel" daemon prio=6 tid=0x0000000007ae9800 nid=0x2da4 runnable 
[0x00000000091cf000]
   java.lang.Thread.State: RUNNABLE
        at java.lang.IllegalStateException.<init>(IllegalStateException.java:55)
        at org.apache.felix.framework.Felix.acquireBundleLock(Felix.java:4955)
        - locked <0x00000000c11bbc88> (a [Ljava.lang.Object;)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1156)
        at 
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:266)
        at java.lang.Thread.run(Thread.java:744)
{code}

This is a side-effect of change FELIX-2942, in which the "for" loop has been 
replaced by a "while" loop on a boolean "bundlesRemaining".  The 
"bundlesRemaining" is not recomputed in every iteration the loop. For instance, 
when a IllegalStateException is caught, it skips to the next iteration of the 
loop ("continue").  It therefore loops infinitely.

Suggestion solution : recompute the boolean "bundlesRemaining" at each 
iteration of the loop (perhaps in a "finally" block ?).

This regression has been introduced in Felix 3.2.x (version 3.0.x) did not have 
this problem.

The impact on ServiceMix users is that "cold undeploy" is broken, but 
fortunately, "warm undeploy" is not.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to