Jetty Server 9.4.10 - Timeout Exception - Idle timeout expired
Asked Answered
F

1

7

I am using jetty server 9.4.10 via dropwizard 1.2.6. I am seeing an exception related to idle timeout like below

ERROR [2018-07-20 07:51:46,726] [U:224,F:832,T:1,056,M:1,820] vnera.restapilayer.CustomerResource:[ManagementResource:uploadBundle:2434] - [dw-103 - POST /management/upgrade/uploadbundle] - Error occurred during file handling..
java.io.IOException: java.util.concurrent.TimeoutException: Idle timeout expired: 30000/30000 ms
        at org.eclipse.jetty.server.HttpInput$ErrorState.noContent(HttpInput.java:1075)
        at org.eclipse.jetty.server.HttpInput.read(HttpInput.java:313)
        at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:999)
        at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:903)
        at java.io.InputStream.read(InputStream.java:101)
        at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1488)
        at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1465)
        at com.vnera.restapilayer.ManagementResource.flushFileToDisk(ManagementResource.java:2538)
        at com.vnera.restapilayer.ManagementResource.storeFileToDisk(ManagementResource.java:2464)
        at com.vnera.restapilayer.ManagementResource.uploadBundle(ManagementResource.java:2389)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
        at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
        at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
        at io.dropwizard.jetty.NonblockingServletHolder.handle(NonblockingServletHolder.java:49)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)
        at io.dropwizard.servlets.ThreadNameFilter.doFilter(ThreadNameFilter.java:34)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
        at io.dropwizard.jersey.filter.AllowedMethodsFilter.handle(AllowedMethodsFilter.java:45)
        at io.dropwizard.jersey.filter.AllowedMethodsFilter.doFilter(AllowedMethodsFilter.java:39)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
        at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:311)
        at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:265)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
        at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
        at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
        at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
        at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
        at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
        at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)

I tried increasing the idle timeout but still the same error like below

ERROR [2018-07-20 14:09:44,970] [U:393,F:687,T:1,080,M:1,820] vnera.restapilayer.CustomerResource:[ManagementResource:uploadBundle:2434] - [dw-157 - POST /management/upgrade/uploadbundle] - Error occurred during file handling..
java.io.IOException: java.util.concurrent.TimeoutException: Idle timeout expired: 1200000/1200000 ms

Can someone let me know what does this exception denote? How can I avoid this?

This looks like an issue in jetty-server as discussed here.

Fluidics answered 20/7, 2018 at 16:1 Comment(3)
Possible duplicate of Unable to access IDempiere - java.io.IOException: java.util.concurrent.TimeoutException: Idle timeout expired: 123000/123000 msNaxos
#47471224 IMO this is the reason - no read or write on the connection.Naxos
I am observing the same issue as discussed in jetty github issues. I am also observing the issue intermittently while making a MULTIPART post request over ssl.Fluidics
F
1

The issue has been discussed in the jetty mailing list. This suggestion solved my issue

First, don't use commons-fileupload, that's for Servlet 2.4 (and older) environments. Support for multipart/form-data parsing is built into the Servlet spec as HttpServletRequest.getParts() and getPart(name) since Servlet 3.0 See:Âhttps://docs.oracle.com/javaee/7/api/javax/servlet/http/HttpServletRequest.html#getPart-java.lang.String-

Removing the usage of commons-fileupload solved the issue for me.

Fluidics answered 21/8, 2019 at 10:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.