In the event of a network error, AsyncListener::onComplete is not called if the preceding call to AsyncListener::onError results in a call to AsyncContext::dispatch. This behaviour is observed starting with Tomcat 10.1.12 as well as 10.1.16 (latest as of this writing). This behaviour is not observed in 10.1.11. I have created two reproducers here: https://gitlab.com/-/snippets/3625015 One reproducer uses Spring Boot, and closely mirrors our production code. The other reproducer uses plain tomcat-embed, and was used by myself to figure out if this was a bug in Tomcat or in Spring. The call to AsyncContext::dispatch is key to triggering this behaviour, without that the call to AsyncListener::onComplete occurs as expected.
Fixed in: - 11.0.x for 11.0.0-M15 onwards - 10.1.x for 10.1.17 onwards - 9.0.x for 9.0.84 onwards - 8.5.x for 8.5.97 onwards Thanks for the test case. I adapted it into a test for the Tomcat test suite.