Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-6375

Log a warning in case a resource resolver is closed by the Sling RR Finalizer thread

    XMLWordPrintableJSON

Details

    Description

      Currently all dangling resource resolvers which are no longer referenced are being automatically closed by Sling in https://github.com/apache/sling/blob/trunk/bundles/resourceresolver/src/main/java/org/apache/sling/resourceresolver/impl/CommonResourceResolverFactoryImpl.java#L100. Unfortunately this happens silently.
      Since all resource resolvers should be closed explicitly in the code (and not rely on this thread to clean them up) there should be an according WARN in the log, whenever an unclosed ResourceResolver is detected and closed.

      A similar logging statement can be seen in https://github.com/apache/jackrabbit/blob/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/SessionImpl.java#L1372.

      Of course it would be very helpful if the stack trace where the resource resolver was opened would be logged as well.

      See also the related discussion at http://www.mail-archive.com/dev@sling.apache.org/msg62779.html.

      Attachments

        Issue Links

          Activity

            People

              jsedding Julian Sedding
              kwin Konrad Windszus
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: