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

Eric Norman closed SLING-10478.
-------------------------------

Closing with the 2.8.0 release

> SlingServletResolver#handleError should not attempt to flush/close an already 
> closed response writer
> ----------------------------------------------------------------------------------------------------
>
>                 Key: SLING-10478
>                 URL: https://issues.apache.org/jira/browse/SLING-10478
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Eric Norman
>            Assignee: Eric Norman
>            Priority: Major
>             Fix For: Servlets Resolver 2.8.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> In SlingServletResolver#handleError if the errorHandler servlet has already 
> closed the response writer, then it should not attempt to flush/close it 
> again.   
> The attempt to flush/close the already closed writer after the errorHandler 
> servlet is invoked can result in a WriterAlreadyClosedException being thrown 
> which can fill up the logs with noise.
> For example, if a custom error handler servlet is generating a JSON error 
> response using a JsonGenerator that writes to the response writer, then 
> closing the JsonGenerator object would also close the response writer.
>  The logs have exceptions like this:
> {noformat}
> java.io.IOException: Error handler failed: 
> org.apache.sling.engine.impl.SlingHttpServletResponseImpl$WriterAlreadyClosedException
>     at 
> org.apache.sling.servlets.resolver.internal.SlingServletResolver.handleError(SlingServletResolver.java:655)
>  [org.apache.sling.servlets.resolver:2.7.14]
>     at 
> org.apache.sling.servlets.resolver.internal.SlingServletResolver.handleError(SlingServletResolver.java:328)
>  [org.apache.sling.servlets.resolver:2.7.14]
>     at 
> org.apache.sling.engine.impl.DefaultErrorHandler.handleError(DefaultErrorHandler.java:97)
>  [org.apache.sling.engine:2.7.6]
> ...{noformat}
> Expected:
> Track whether the response writer is closed and skip the flush/close calls if 
> it is already closed.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to