[ 
https://issues.apache.org/jira/browse/SLING-7313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16294999#comment-16294999
 ] 

ASF GitHub Bot commented on SLING-7313:
---------------------------------------

kwin commented on a change in pull request #1: SLING-7313 refresh the resource 
type resolver as well
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/1#discussion_r157487797
 
 

 ##########
 File path: 
src/main/java/org/apache/sling/resourceresolver/impl/helper/ResourceResolverControl.java
 ##########
 @@ -148,12 +148,20 @@ private void logout() {
     }
 
     /**
-     * Refreshes all refreshable providers.
+     * Refreshes all refreshable providers as well as the resolver used for 
resource types.
      */
     public void refresh(@Nonnull final ResourceResolverContext context) {
         for (final AuthenticatedResourceProvider p : 
context.getProviderManager().getAllUsedRefreshable()) {
             p.refresh();
         }
+        if (this.resourceTypeResourceResolver != null) {
+            try {
+                this.resourceTypeResourceResolver.close();
 
 Review comment:
   Yes, of course. Good catch

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> ResourceResolverImpl#refresh should also refresh the internal 
> resourceTyperesourceResolver
> ------------------------------------------------------------------------------------------
>
>                 Key: SLING-7313
>                 URL: https://issues.apache.org/jira/browse/SLING-7313
>             Project: Sling
>          Issue Type: Improvement
>          Components: ResourceResolver
>    Affects Versions: Resource Resolver 1.5.32
>            Reporter: Julian Sedding
>            Priority: Minor
>         Attachments: refresh-session.txt
>
>
> I noticed warning log messages due to long-lived Oak sessions (see 
> attachment) and traced them back to a long-lived service {{ResourceResolver}} 
> in the I18N code ({{JcrResourceBundleProvider}}). Care is taken to 
> periodically refresh this {{ResourceResolver}}, however, the {{#refresh()}} 
> call is not propagated to the internal {{resourceTypeResourceResolver}} used 
> by {{ResourceResolverImpl}} and thus a warning is logged.
> This could be solved by using short-lived RRs in the I18N code, but I think 
> we should also refresh the internal {{resourceTypeResourceResolver}} used by 
> {{ResourceResolverImpl}} when RR is refreshed.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to