You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2012/11/01 09:29:11 UTC

[jira] [Created] (FELIX-3743) Potential endless loop setting the active framework startlevel

Felix Meschberger created FELIX-3743:
----------------------------------------

             Summary: Potential endless loop setting the active framework startlevel
                 Key: FELIX-3743
                 URL: https://issues.apache.org/jira/browse/FELIX-3743
             Project: Felix
          Issue Type: Bug
          Components: Framework
    Affects Versions: framework-4.0.2
            Reporter: Felix Meschberger
             Fix For: framework-4.2.0


We experience an issue with setting the framework startlevel in the Felix.setActiveStartLevel(int, FrameworkListener[]) method.

On line 1216 the bundle lock is acquired. If this fails with an IllegalStateException the loop just continues. But the bundle remains in the m_startLevelBundles set and is retried later. In the case of an uninstalled bundle, this situation will not change and the method is probabl going into an endless loop.

Would it make sense to remove the bundle from the m_startLevelBundles set in the catch block starting line 1223 if the bundle has been uninstalled ?

Proposed patch:

Index: Felix.java
===================================================================
--- Felix.java	(revision 1404016)
+++ Felix.java	(working copy)
@@ -1227,6 +1227,14 @@
                                Logger.LOG_ERROR,
                                "Error locking " + tuple.m_bundle._getLocation(), ex);
                        }
+                        else
+                        {
+                            synchronized (m_startLevelBundles)
+                            {
+                                m_startLevelBundles.remove(tuple);
+                                bundlesRemaining = !m_startLevelBundles.isEmpty();
+                            }
+                        }
                        continue;
                    }


--
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

[jira] [Resolved] (FELIX-3743) Potential endless loop setting the active framework startlevel

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3743?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved FELIX-3743.
--------------------------------------

    Resolution: Fixed
      Assignee: Felix Meschberger

Committed the patch in Rev. 1404499

This removes uninstalled bundles from the set of bundles to handle.

Another cause for an IllegalStateException thrown from acquiring the bundle lock is failure to get the lock. In this case the bundle remains in the set and is retried later.
                
> Potential endless loop setting the active framework startlevel
> --------------------------------------------------------------
>
>                 Key: FELIX-3743
>                 URL: https://issues.apache.org/jira/browse/FELIX-3743
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-4.0.2
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: framework-4.2.0
>
>
> We experience an issue with setting the framework startlevel in the Felix.setActiveStartLevel(int, FrameworkListener[]) method.
> On line 1216 the bundle lock is acquired. If this fails with an IllegalStateException the loop just continues. But the bundle remains in the m_startLevelBundles set and is retried later. In the case of an uninstalled bundle, this situation will not change and the method is probabl going into an endless loop.
> Would it make sense to remove the bundle from the m_startLevelBundles set in the catch block starting line 1223 if the bundle has been uninstalled ?
> Proposed patch:
> Index: Felix.java
> ===================================================================
> --- Felix.java	(revision 1404016)
> +++ Felix.java	(working copy)
> @@ -1227,6 +1227,14 @@
>                                 Logger.LOG_ERROR,
>                                 "Error locking " + tuple.m_bundle._getLocation(), ex);
>                         }
> +                        else
> +                        {
> +                            synchronized (m_startLevelBundles)
> +                            {
> +                                m_startLevelBundles.remove(tuple);
> +                                bundlesRemaining = !m_startLevelBundles.isEmpty();
> +                            }
> +                        }
>                         continue;
>                     }

--
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

[jira] [Closed] (FELIX-3743) Potential endless loop setting the active framework startlevel

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3743?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard S. Hall closed FELIX-3743.
----------------------------------

    
> Potential endless loop setting the active framework startlevel
> --------------------------------------------------------------
>
>                 Key: FELIX-3743
>                 URL: https://issues.apache.org/jira/browse/FELIX-3743
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-4.0.2
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: framework-4.2.0
>
>
> We experience an issue with setting the framework startlevel in the Felix.setActiveStartLevel(int, FrameworkListener[]) method.
> On line 1216 the bundle lock is acquired. If this fails with an IllegalStateException the loop just continues. But the bundle remains in the m_startLevelBundles set and is retried later. In the case of an uninstalled bundle, this situation will not change and the method is probabl going into an endless loop.
> Would it make sense to remove the bundle from the m_startLevelBundles set in the catch block starting line 1223 if the bundle has been uninstalled ?
> Proposed patch:
> Index: Felix.java
> ===================================================================
> --- Felix.java	(revision 1404016)
> +++ Felix.java	(working copy)
> @@ -1227,6 +1227,14 @@
>                                 Logger.LOG_ERROR,
>                                 "Error locking " + tuple.m_bundle._getLocation(), ex);
>                         }
> +                        else
> +                        {
> +                            synchronized (m_startLevelBundles)
> +                            {
> +                                m_startLevelBundles.remove(tuple);
> +                                bundlesRemaining = !m_startLevelBundles.isEmpty();
> +                            }
> +                        }
>                         continue;
>                     }

--
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

[jira] [Commented] (FELIX-3743) Potential endless loop setting the active framework startlevel

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3743?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13507100#comment-13507100 ] 

Richard S. Hall commented on FELIX-3743:
----------------------------------------

This patch looks reasonable to me too, so I'll close this issue.
                
> Potential endless loop setting the active framework startlevel
> --------------------------------------------------------------
>
>                 Key: FELIX-3743
>                 URL: https://issues.apache.org/jira/browse/FELIX-3743
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-4.0.2
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: framework-4.2.0
>
>
> We experience an issue with setting the framework startlevel in the Felix.setActiveStartLevel(int, FrameworkListener[]) method.
> On line 1216 the bundle lock is acquired. If this fails with an IllegalStateException the loop just continues. But the bundle remains in the m_startLevelBundles set and is retried later. In the case of an uninstalled bundle, this situation will not change and the method is probabl going into an endless loop.
> Would it make sense to remove the bundle from the m_startLevelBundles set in the catch block starting line 1223 if the bundle has been uninstalled ?
> Proposed patch:
> Index: Felix.java
> ===================================================================
> --- Felix.java	(revision 1404016)
> +++ Felix.java	(working copy)
> @@ -1227,6 +1227,14 @@
>                                 Logger.LOG_ERROR,
>                                 "Error locking " + tuple.m_bundle._getLocation(), ex);
>                         }
> +                        else
> +                        {
> +                            synchronized (m_startLevelBundles)
> +                            {
> +                                m_startLevelBundles.remove(tuple);
> +                                bundlesRemaining = !m_startLevelBundles.isEmpty();
> +                            }
> +                        }
>                         continue;
>                     }

--
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