-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
2.1.2.Final, 2.1.3.Final
-
None
Request attributes can be cleared before servlet filters have completed running. This appeared in 2.1.2.Final. I think this was introduced here:
https://github.com/undertow-io/undertow/commit/41501ac05dbb963c912216cdb9cfb3e175ee3bd4
And is a recurrence of this: https://issues.redhat.com/browse/UNDERTOW-1573
I think it's more significant though because the servlet filter has not completed running when attributes are cleared? Also no request body was present, I hit this with a GET call.
Example of what triggered the problem:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { try { request.setAttribute("REQUEST_START_NANOS", System.nanoTime()); } finally { // unboxing triggers an NPE long start = (long)request.getAttribute("REQUEST_START_NANOS"); log.info("Request duration={}", System.nanoTime() - start); } }
- duplicates
-
UNDERTOW-1743 Request attributes are lost when a client closes a connection while response is being written
- Resolved