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

Carsten Ziegeler edited comment on SLING-12372 at 7/9/24 5:20 AM:
------------------------------------------------------------------

I don't know the details of the model adapter factory, but why is it not 
storing things in request attributes instead of using a cache where a request 
object is the key?

Other options are to bind the cache to the resource resolver, which doesn't 
require a listener at all or a Sling request listener


was (Author: cziegeler):
I don't know the details of the model adapter factory, but why is it not 
storing things in request attributes instead of using a cache where a request 
object is the key?

> ModelAdapterFactory is not cleaning up the requests correctly
> -------------------------------------------------------------
>
>                 Key: SLING-12372
>                 URL: https://issues.apache.org/jira/browse/SLING-12372
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Roy Teeuwen
>            Priority: Critical
>
> With the recent changes in Apache Felix of making Felix compatible with both 
> javax and jakarta, new ServletRequestWrappers were introduced:
> [https://github.com/apache/felix-dev/blob/master/http/wrappers/src/main/java/org/apache/felix/http/javaxwrappers/ServletRequestWrapper.java#L79]
> This causes issues for the cleanup / disposing of requests after a 
> requestDestroyed event is caught in the ModelAdapterFactory, namely there is 
> a check if the request is of type javax.http.ServletRequestWrapper, which no 
> longer matches with org.apache.felix.http.javaxwrappers.ServletRequestWrapper:
> [https://github.com/apache/sling-org-apache-sling-models-impl/blob/master/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java#L796]
> This causes the callbacks to never be cleaned up, because the original 
> ServletRequest is not matched seeing as it is a new wrapper object compared 
> to the one that was put.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to