You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (Jira)" <ji...@apache.org> on 2024/07/09 13:10:00 UTC

[jira] [Resolved] (SLING-12372) ModelAdapterFactory is not cleaning up the requests correctly

     [ https://issues.apache.org/jira/browse/SLING-12372?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler resolved SLING-12372.
--------------------------------------
    Resolution: Fixed

Changed the logic to simply rely on a request attribute instead of a map where a request object is the key.
The list is set as a request attribute when the requests starts and then destroyed when the request finishes.

> 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
>            Assignee: Carsten Ziegeler
>            Priority: Critical
>             Fix For: Models Implementation 1.7.2
>
>
> 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)