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

Julian Sedding commented on SLING-6378:
---------------------------------------

[~fmeschbe] This was produced with a trunk {{launchpad/builder}}, i.e. Sling 
Authentication Core 1.3.22. However, as I wrote in the description, I believe 
that the culprit is {{AuthHttpContext}} delegating to the 
{{SlingAuthenticator}}. I suspect that the SlingAuthenticator does not get the 
{{requestDestroyed}} callback, because the servlet has it's own context. I 
suspect you have a better overview of how the HttpService works, so please let 
me know if my assumptions are incorrect.

You should be able to reproduce the stacktrace with the latest trunk (updated 
to resourceresolver snapshot), when you build {{launchpad/builder}} or 
{{launchpad/testing}}. The build is successful, but grepping the log for 
"Unclosed ResourceResolver" yields several occurrences of the stacktrace above.

> Unclosed ResourceResolver in davex AuthHttpContext
> --------------------------------------------------
>
>                 Key: SLING-6378
>                 URL: https://issues.apache.org/jira/browse/SLING-6378
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR Davex 1.3.4
>            Reporter: Julian Sedding
>
> The changes in SLING-6375 reveal an unclosed ResourceResolver in 
> {{org.apache.sling.jcr.davex.impl.servlets.AuthHttpContext}}. The 
> {{AuthHttpContext}} delegates to {{SlingAuthenticator}} to open the RR. 
> However, {{SlingAuthenticator}} relies on 
> {{ServletRequestListener##requestDestroyed}} to be called in order to close 
> the RR. It seems that this does not happen in this case, as 
> {{SlingAuthenticator}} is called directly in this case.
> {noformat}
> 08.12.2016 14:43:19.385 *INFO* [Apache Sling Resource Resolver Finalizer 
> Thread] 
> org.apache.sling.resourceresolver.impl.CommonResourceResolverFactoryImpl 
> Unclosed ResourceResolver was created here: 
> java.lang.Exception: null
>         at 
> org.apache.sling.resourceresolver.impl.CommonResourceResolverFactoryImpl$ResolverReference.<init>(CommonResourceResolverFactoryImpl.java:466)
>         at 
> org.apache.sling.resourceresolver.impl.CommonResourceResolverFactoryImpl.register(CommonResourceResolverFactoryImpl.java:200)
>         at 
> org.apache.sling.resourceresolver.impl.ResourceResolverImpl.<init>(ResourceResolverImpl.java:117)
>         at 
> org.apache.sling.resourceresolver.impl.ResourceResolverImpl.<init>(ResourceResolverImpl.java:110)
>         at 
> org.apache.sling.resourceresolver.impl.CommonResourceResolverFactoryImpl.getResourceResolverInternal(CommonResourceResolverFactoryImpl.java:245)
>         at 
> org.apache.sling.resourceresolver.impl.CommonResourceResolverFactoryImpl.getResourceResolver(CommonResourceResolverFactoryImpl.java:155)
>         at 
> org.apache.sling.resourceresolver.impl.ResourceResolverFactoryImpl.getResourceResolver(ResourceResolverFactoryImpl.java:101)
>         at 
> org.apache.sling.auth.core.impl.SlingAuthenticator.getAnonymousResolver(SlingAuthenticator.java:869)
>         at 
> org.apache.sling.auth.core.impl.SlingAuthenticator.doHandleSecurity(SlingAuthenticator.java:500)
>         at 
> org.apache.sling.auth.core.impl.SlingAuthenticator.handleSecurity(SlingAuthenticator.java:459)
>         at 
> org.apache.sling.jcr.davex.impl.servlets.AuthHttpContext.handleSecurity(AuthHttpContext.java:85)
>         at 
> org.apache.felix.http.base.internal.service.ServletContextImpl.handleSecurity(ServletContextImpl.java:421)
>         at 
> org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:57)
>         at 
> org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:128)
>         at 
> org.apache.felix.http.base.internal.dispatch.DispatcherServlet.service(DispatcherServlet.java:49)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
>         at 
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
>         at 
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
>         at 
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
>         at 
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
>         at 
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
>         at 
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
>         at 
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
>         at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>         at 
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
>         at 
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
>         at org.eclipse.jetty.server.Server.handle(Server.java:523)
>         at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
>         at 
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
>         at 
> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
>         at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
>         at 
> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
>         at 
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
>         at 
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
>         at 
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
>         at 
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
>         at 
> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
>         at java.lang.Thread.run(Thread.java:745)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to