-
Notifications
You must be signed in to change notification settings - Fork 40.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tomcat: java.lang.IllegalStateException: Calling [asyncError()] is not valid for a request with Async state [MUST_DISPATCH] #15057
Comments
Looking at that Framework issue, it was tracked down to a bug in Tomcat. You haven't said which version of Boot you upgraded from, but you may have picked up a new version of Tomcat as part of that upgrade that contains a regression. However, it's impossible to say with any degree of certainty based on so little information. If you'd like us to spend some more time looking at this, please take the time to provide a minimal sample that reproduces the problem. Given that the previous, similar problem was a bug in Tomcat, I think it's unlikely that this is going to be a Spring Boot bug, but we can route the issue accordingly once we have a sample that reproduces it. |
@wilkinsona Previous version was 2.0.x and as I understand 2.1 brings major Tomcat (9) update as dependency. Linked Tomcat ticket mention |
Minimal example with Tomcat errors To see error: open Switching to Undertow makes log clean |
Thanks for the sample. I've reproduced the problem, but I've only been able to do so by killing the client that's connected to the event stream, for example by using curl and CTRL+C. Upon doing so, I see the following in the log:
Using the debugger, I can see that the failure that's triggered an error state to be set is an IO exception due to a broken pipe. If I downgrade Tomcat to 8.5.34 a failure occurs but it is different and more obviously caused by the broken pipe:
If I downgrade to Spring Boot 2.0.6 (which uses Tomcat 8.5.34) I see the same behaviour as Spring Boot 2.1.0 with Tomcat 8.5.34. As far as I can tell, the only thing that's changed here is Tomcat's error handling with the exception that are logged by 8.5.x and 9.0.x being different. The fundamental behaviour appears to be the same though. @vitalyster If you have observed something different to what I have described above, can you please provide detailed instructions that describe exactly how to reproduce it? |
Yes, I saw the same on Spring Boot 2.0.6, and that error was tracked on Spring JIRA too and I already tried to bump closed ticket but they forbid it :) |
The commit that addressed SPR-16528 changed to log level for async timeout but not for a broken pipe. If you believe there's a further refinement to be made in Framework, I would recommend opening a new Framework issue although there's probably a good reason for why @rstoyanchev only changed one and not the other. That said, a change in Framework isn't going to help you with Tomcat 9 as it's Tomcat that's logging the error message in that case not Framework. If you'd like to pursue that side of things, I'd recommend opening a Tomcat issue. I'm going to close this one as none of the changes in behaviour are due to Spring Boot itself and any changes in what's logged and at what level will have to be made in Spring Framework or Tomcat. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This issue was closed with |
The Tomcat issue is 56042. |
I had this issue today, I can confirm that after updating the (embedded) tomcat to version 9.0.29, the error didn't occur anymore. |
After upgrading to Spring Boot 2.1.0 the logs are full of these errors. Looks like it was tracked in Spring JIRA before but marked as resolved
The text was updated successfully, but these errors were encountered: