Code demonstrating the issue: https://github.com/rstoyanchev/dispatch-test Checkout the 'tomcat-issue-repro' branch. From the home page of the deployed application, select the "Dispatch via AsyncContext" scenario. The scenario involves ServletA forwarding to ServletB and ServletC, which in turn creates a thread and dispatches to ServletD. The DispatchType in ServletD should be ASYNC but is INCLUDE instead. FWIW when the request is wrapped (scenarion "Dispatch via AsyncContext and wrap request"), the DispatchType is correct.
I assume at some point the debug logging was outputting the result of request.getDispatchType(). The version provided doesn't do this but I have added the line to do this in my local copy. This issue has the same root cause as bug 53623 so I am marking it as a duplicate since it is really just a different symptom of the same underlying problem. *** This bug has been marked as a duplicate of bug 53623 ***