Enable async with Jetty

1,548 views
Skip to first unread message

Adam Wead

unread,
Nov 13, 2014, 12:41:01 PM11/13/14
to Fedora Tech
Hi,

I’m tracking down an issue with fixity checks when running Fedora under jetty. After upgrading to the latest Jetty 8, I’m getting a failure (stack trace below). Does anyone know how you enable asynchronous request processing in a servlet?

tia,

…adam


WARN 12:30:56.986 (ResponseWriter) Attempt to put servlet request into asynchronous mode has failed. Please check your servlet configuration - all Servlet instances and Servlet filters involved in the request processing must explicitly declare support for asynchronous request processing.
java.lang.IllegalStateException: !asyncSupported
at org.eclipse.jetty.server.Request.startAsync(Request.java:2016) ~[jetty-server-8.1.13.v20130916.jar:8.1.16.v20140903]
at org.glassfish.jersey.servlet.async.AsyncContextDelegateProviderImpl$ExtensionImpl.suspend(AsyncContextDelegateProviderImpl.java:87) ~[jersey-container-servlet-2.13.jar:na]
at org.glassfish.jersey.servlet.internal.ResponseWriter.suspend(ResponseWriter.java:121) ~[jersey-container-servlet-core-2.13.jar:na]
at org.glassfish.jersey.server.ServerRuntime$AsyncResponder.suspend(ServerRuntime.java:808) [jersey-server-2.13.jar:na]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:322) [jersey-server-2.13.jar:na]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:101) [jersey-server-2.13.jar:na]
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:271) [jersey-server-2.13.jar:na]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) [jersey-common-2.13.jar:na]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) [jersey-common-2.13.jar:na]
at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [jersey-common-2.13.jar:na]
at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [jersey-common-2.13.jar:na]
at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [jersey-common-2.13.jar:na]
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:297) [jersey-common-2.13.jar:na]
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:254) [jersey-server-2.13.jar:na]
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1030) [jersey-server-2.13.jar:na]
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:373) [jersey-container-servlet-core-2.13.jar:na]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:381) [jersey-container-servlet-core-2.13.jar:na]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:344) [jersey-container-servlet-core-2.13.jar:na]
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221) [jersey-container-servlet-core-2.13.jar:na]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684) [jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503) [jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533) [jetty-security-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429) [jetty-servlet-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.server.Server.handle(Server.java:370) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644) [jetty-http-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) [jetty-http-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264) [jetty-server-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) [jetty-util-8.1.16.v20140903.jar:8.1.16.v20140903]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_67]

Esmé Cowles

unread,
Nov 13, 2014, 12:50:27 PM11/13/14
to fedor...@googlegroups.com
Adam-

I found this page:

https://wiki.eclipse.org/Jetty/Feature/Continuations#Asynchronous_RESTful_Web_Service

which touts the advantages of async servlets, and then links to more info. Of course the link is 404...

Anyway, I know there has been some discussion of adding async features for handling async storage like Glacier. But AFAIK, none of that has actually been done yet. So I don't think fcrepo4 is trying to use async mode.

-Esme
> --
> You received this message because you are subscribed to the Google Groups "Fedora Tech" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to fedora-tech...@googlegroups.com.
> To post to this group, send email to fedor...@googlegroups.com.
> Visit this group at http://groups.google.com/group/fedora-tech.
> For more options, visit https://groups.google.com/d/optout.

Adam Wead

unread,
Nov 13, 2014, 12:57:34 PM11/13/14
to fedor...@googlegroups.com

Esmé Cowles

unread,
Nov 13, 2014, 12:59:56 PM11/13/14
to fedor...@googlegroups.com
Adam-

I stand corrected -- I didn't see that.

-Esme

Andrew Woods

unread,
Nov 13, 2014, 1:00:04 PM11/13/14
to fedor...@googlegroups.com
Hello Adam,
Here is the description of the Jetty change and a likely entry point to the necessary configuration:

Did your upgrade jump from before 8.1.12 to after it?

Yes, server side async support was added last sprint in the context of fixity, as Adam just raised, which has nothing to do with the user interaction, but rather offers performance improvements on the server side by splitting the fixity task into a background thread.
Andrew




Adam Wead

unread,
Nov 13, 2014, 1:03:39 PM11/13/14
to fedor...@googlegroups.com
Thanks, Andrew, let me look at that… I’m updating jetty from 8.1.10 to 8.1.16. I suspect the previous version was causing the CPU issue because of this very reason.

It’s outlined here https://github.com/fcrepo4/fcrepo4/issues/642 but is not related to the insert time issue, as far as I know.

…adam

Reply all
Reply to author
Forward
0 new messages