Sling
  1. Sling
  2. SLING-36

Repository Based components not cleaned up when not existing any longer

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Won't Fix
    • Affects Version/s: 3
    • Fix Version/s: 3
    • Component/s: Engine
    • Labels:
      None

      Description

      The RepositoryComponentRegistration services access the JCR repository to see whether there are any component descriptors stored in the repository and updates the component registry in case of new, modified or removed components.

      Unfortunately, this service does not pay attention to the fact, that a bundle providing mappings for such components may be stopped, removed, added or updated. In such cases the registered components are not touched and stay. In fact new components will not be visible until after a restart of the RepositoryComponentResgistration.

      The registration of JCR based components must be modified to take into account that OCM mappings for such components may be added and/or removed at run time and that there is another influence on the state of registered components than just the repository.

        Activity

        Felix Meschberger created issue -
        Hide
        Felix Meschberger added a comment -

        The issue is actually different and just manifests itself such that the ScriptComponent still refers to an
        old instance of the ScriptManager. The real cause is, that the JCR based Components (of which ScriptedComponent is an instance) are not removed from the system once the bundle providing the implementation class and OCM mapping are stopped.

        This causes the ScriptComponents to stay and still have the old reference.

        Show
        Felix Meschberger added a comment - The issue is actually different and just manifests itself such that the ScriptComponent still refers to an old instance of the ScriptManager. The real cause is, that the JCR based Components (of which ScriptedComponent is an instance) are not removed from the system once the bundle providing the implementation class and OCM mapping are stopped. This causes the ScriptComponents to stay and still have the old reference.
        Felix Meschberger made changes -
        Field Original Value New Value
        Summary ScriptedComponent has a static reference to ScriptManager which seems to stick beyond bundle udpate Repository Based components not cleaned up when not existing any longer
        Component/s Scripting [ 12311942 ]
        Description The ScriptedComponent uses the ScriptManager to resolve the script to ComponentRenderer to actually call the script. This reference is static and obviously even survives PackageAdmin.resolveBundle() calls if the scripting core bundle is updated.

        The ScriptedComponent instances are loaded by the Core bundle and instantiated by the Content-JCR bundle.

        It has to be discovered whether this is a class loader artefact which may have to be solved in the realm of Felix as the OSGi framework.

        On the other hand, using a static reference to a class is not the best of all solutions. A better solution trating the ScriptManager as a service must be found.
        The RepositoryComponentRegistration services access the JCR repository to see whether there are any component descriptors stored in the repository and updates the component registry in case of new, modified or removed components.

        Unfortunately, this service does not pay attention to the fact, that a bundle providing mappings for such components may be stopped, removed, added or updated. In such cases the registered components are not touched and stay. In fact new components will not be visible until after a restart of the RepositoryComponentResgistration.

        The registration of JCR based components must be modified to take into account that OCM mappings for such components may be added and/or removed at run time and that there is another influence on the state of registered components than just the repository.
        Component/s Core [ 12311940 ]
        Hide
        Felix Meschberger added a comment -

        Issue pertains to former Component API and has no correspondence with the new Sling API. Closing.

        Show
        Felix Meschberger added a comment - Issue pertains to former Component API and has no correspondence with the new Sling API. Closing.
        Felix Meschberger made changes -
        Resolution Won't Fix [ 2 ]
        Status Open [ 1 ] Closed [ 6 ]
        Felix Meschberger made changes -
        Workflow jira [ 12414240 ] no-reopen-closed,doc-test-required [ 12475407 ]
        Gavin made changes -
        Workflow no-reopen-closed,doc-test-required [ 12475407 ] Copy of no-reopen-closed,doc-test-required [ 12763004 ]
        Gavin made changes -
        Workflow Copy of no-reopen-closed,doc-test-required [ 12763004 ] no-reopen-closed,doc-test-required [ 12766718 ]
        Gavin made changes -
        Workflow no-reopen-closed,doc-test-required [ 12766718 ] re-open possible,doc-test-required [ 12788092 ]
        Gavin made changes -
        Workflow re-open possible,doc-test-required [ 12788092 ] no-reopen-closed,doc-test-required [ 12790913 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Felix Meschberger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development