-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Failed to serve resource java.lang.IllegalStateException: s=HANDLING rs=ASYNC os=OPEN is=IDLE awp=false se=false i=true al=0 #12153
Comments
There's something missing from this. Is this the result of a RequestDispatch to index.html? |
What is your DefaultServlet (or ResourceServlet) configuration? |
WebAppContext.dump (redacted)
|
I have a HttpFilter that listens for URL paths ending with .html, which then uses a request dispatcher to some other resource (with a different suffix). Maybe that's what's tripping it (not that it should). |
Your LFilter on url-pattern |
What does that mean, and how can I disable it? These are simple HttpFilters that I add via ServletHandler.addFilterWithMapping(FilterHolder,String pathSpec,EnumSet(REQUEST)) Notably, calling FilterHolder.setAsyncSupported with either true or false has no effect. Again, everything works fine with either 12.0.7 or by adding the above check. |
Calling
|
It's a useful finding, something isn't right. |
We ran into this too. Working around by disabling async seems to work.
dump here: https://gist.github.com/stevenschlansker/478bbedfe1b59639783578b2bc1e41e0 |
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Between Jetty 12.0.7 and 12.0.8, cross-context dispatching was re-introduced. This changed touched a lot of code related to this issue so while I suspect it is the change that introduced this problem, I'm not yet sure of what's going on because there are too many lose ends, and I have too little data to narrow down the bug. At the core of this problem, it seems that you have two I've created a PR that contains extra debug information that should report where the original Once we do understand the problem, we'll be able to reproduce it and come up with a fix. In the meantime, I suspect that we should simply check that the async context already is started and don't try to start it twice. It can be done by patching EE10 --- AsyncContext asyncContext = httpServletRequest.startAsync();
+++ AsyncContext asyncContext = httpServletRequest.isAsyncStarted() ? httpServletRequest.getAsyncContext() : httpServletRequest.startAsync(); Nevertheless, we need to be able to reproduce the issue you're facing before committing this fix. Thanks! |
…artAsync Signed-off-by: Ludovic Orban <lorban@bitronix.be>
…artAsync Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Jetty version(s)
12.0.8 onwards
Jetty Environment
ee10
Java version/vendor
(use: java -version)
any
OS type/version
any, macOS
Description
While trying to serve a path that redirects to an "index.html" file, jetty 12.0.8 or newer fails with an IllegalStateException.
Apparently, the "RequestState" was already ASYNC, and so the test in startAsync fails.
How to reproduce?
This is from an embedded setup I can't currently share, but I hope the stacktrace above is sufficient (notice the absence of any application-specific stacktrace elements)
However, allowing the existing
requestState == ASYNC
fixes the issue:in ServletChannelState.startAsync:
The text was updated successfully, but these errors were encountered: