I have a Tomcat Filter that delegates requests to the a handling object depending on the URL. This is the only filter in the FilterChain. I have an Ajax app that hammers this filter with lots of requests.
Recently I noticed an issue where the filter's doFilter method is often called with a committed response as a parameter (Internally, it is the coyote response that is marked committed).
It seems to me that the only way that this can happen is if the recycle() method is not called on this coyote response. I have checked to make sure that I am not keeping references to any of the request, response, outputStream, or writer objects. Additionally, I made sure to close the outputStream in a finally block. However, this doesn't resolve this issue.
This sounds like I am doing something to abuse the servlet container but I am having trouble tracking it down.