[ https://issues.apache.org/jira/browse/SLING-12421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17882024#comment-17882024 ]
Julian Sedding commented on SLING-12421: ---------------------------------------- After looking into how this could be improved, I concluded that the lowest risk change is to not set {{theServlet}} to {{null}} when it is being destroyed. > Race between serving request and destroying JspServletWrapper > ------------------------------------------------------------- > > Key: SLING-12421 > URL: https://issues.apache.org/jira/browse/SLING-12421 > Project: Sling > Issue Type: Bug > Components: Scripting > Affects Versions: Scripting JSP 2.6.2 > Reporter: Julian Sedding > Assignee: Julian Sedding > Priority: Minor > Fix For: Scripting JSP 2.6.4 > > > When a {{JspServletWrapper}} is destroyed, it is possible that a request is > still being served concurrently. This can lead to a {{NullPointerException}} > if the internal field {{theServlet}} is already set to {{null}} by the time > it's {{service()}} method is called. > To fix this, {{theServlet}} should be copied to a local field at the > beginning of the {{JspServletWrapper#service()}} method. -- This message was sent by Atlassian Jira (v8.20.10#820010)