java - Dropwizard 0.7 service hangs while writing output -


i have dropwizard 0.7.0 service.

  • jetty 9.0.7
  • jersey 1.18.1

occasionally (1 in 5000 requests) service spend 60 seconds writing response. appdynamics showing 60 seconds being spent inside com.sun.jersey.spi.container.servlet.webcomponent$writer:write:300. after 60 seconds following exception:

org.eclipse.jetty.io.eofexception.closed   @ org.eclipse.jetty.server.httpoutput.write(httpoutput.java:171)   @ org.eclipse.jetty.servlets.gzip.abstractcompressedstream.write(abstractcompressedstream.java:226)   @ com.sun.jersey.spi.container.servlet.webcomponent$writer.write(webcomponent.java:300)   @ com.sun.jersey.spi.container.containerresponse$committingoutputstream.write(containerresponse.java:135)   @ com.fasterxml.jackson.core.json.utf8jsongenerator._flushbuffer(utf8jsongenerator.java:1862)   @ com.fasterxml.jackson.core.json.utf8jsongenerator.close(utf8jsongenerator.java:1087)   @ com.fasterxml.jackson.jaxrs.base.providerbase.writeto(providerbase.java:649)   @ com.sun.jersey.spi.container.containerresponse.write(containerresponse.java:302)   @ com.sun.jersey.server.impl.application.webapplicationimpl._handlerequest(webapplicationimpl.java:1510)   @ com.sun.jersey.server.impl.application.webapplicationimpl.handlerequest(webapplicationimpl.java:1419)   @ com.sun.jersey.server.impl.application.webapplicationimpl.handlerequest(webapplicationimpl.java:1409)   @ com.sun.jersey.spi.container.servlet.webcomponent.service(webcomponent.java:409)   @ com.sun.jersey.spi.container.servlet.servletcontainer.service(servletcontainer.java:540)   @ com.sun.jersey.spi.container.servlet.servletcontainer.service(servletcontainer.java:715)   @ javax.servlet.http.httpservlet.service(httpservlet.java:848)   @ io.dropwizard.jetty.nonblockingservletholder.handle(nonblockingservletholder.java:49)   @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1515)   @ org.eclipse.jetty.servlets.useragentfilter.dofilter(useragentfilter.java:83)   @ org.eclipse.jetty.servlets.gzipfilter.dofilter(gzipfilter.java:348)   @ io.dropwizard.jetty.bidigzipfilter.dofilter(bidigzipfilter.java:127)   @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1486)   @ io.dropwizard.servlets.threadnamefilter.dofilter(threadnamefilter.java:29)   @ org.eclipse.jetty.servlet.servlethandler$cachedchain.dofilter(servlethandler.java:1486)   @ org.eclipse.jetty.servlet.servlethandler.dohandle(servlethandler.java:519)   @ org.eclipse.jetty.server.handler.contexthandler.dohandle(contexthandler.java:1097)   @ org.eclipse.jetty.servlet.servlethandler.doscope(servlethandler.java:448)   @ org.eclipse.jetty.server.handler.contexthandler.doscope(contexthandler.java:1031)   @ org.eclipse.jetty.server.handler.scopedhandler.handle(scopedhandler.java:136)   @ org.eclipse.jetty.server.handler.handlerwrapper.handle(handlerwrapper.java:97)   @ com.codahale.metrics.jetty9.instrumentedhandler.handle(instrumentedhandler.java:173)   @ io.dropwizard.jetty.routinghandler.handle(routinghandler.java:51)   @ org.eclipse.jetty.server.handler.handlerwrapper.handle(handlerwrapper.java:97)   @ org.eclipse.jetty.server.handler.requestloghandler.handle(requestloghandler.java:92)   @ org.eclipse.jetty.server.handler.handlerwrapper.handle(handlerwrapper.java:97)   @ org.eclipse.jetty.server.handler.statisticshandler.handle(statisticshandler.java:162)   @ org.eclipse.jetty.server.handler.handlerwrapper.handle(handlerwrapper.java:97)   @ org.eclipse.jetty.server.server.handle(server.java:446)   @ org.eclipse.jetty.server.httpchannel.handle(httpchannel.java:271)   @ org.eclipse.jetty.server.httpconnection.onfillable(httpconnection.java:246)   @ org.eclipse.jetty.io.abstractconnection$readcallback.run(abstractconnection.java:358)   @ org.eclipse.jetty.util.thread.queuedthreadpool.runjob(queuedthreadpool.java:601)   @ org.eclipse.jetty.util.thread.queuedthreadpool$3.run(queuedthreadpool.java:532)   @ java.lang.thread.run(thread.java:744) 

we see following in logs shows connection idle @ least 30 seconds:

warn  [2015-05-14 09:54:30,511] org.eclipse.jetty.server.httpchannel: commit failed ! java.util.concurrent.timeoutexception: idle timeout expired: 30001/30000 ms ! @ org.eclipse.jetty.io.idletimeout.checkidletimeout(idletimeout.java:153) ~[report-configuration-service-1.0.6.2.0.jar:na] ! @ org.eclipse.jetty.io.idletimeout$1.run(idletimeout.java:50) ~[report-configuration-service-1.0.6.2.0.jar:na] ! @ java.util.concurrent.executors$runnableadapter.call(executors.java:471) ~[na:1.7.0_45] ! @ java.util.concurrent.futuretask.run(futuretask.java:262) ~[na:1.7.0_45] ! @ java.util.concurrent.scheduledthreadpoolexecutor$scheduledfuturetask.access$201(scheduledthreadpoolexecutor.java:178) ~[na:1.7.0_45] ! @ java.util.concurrent.scheduledthreadpoolexecutor$scheduledfuturetask.run(scheduledthreadpoolexecutor.java:292) ~[na:1.7.0_45] ! @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) ~[na:1.7.0_45] ! @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) ~[na:1.7.0_45] ! @ java.lang.thread.run(thread.java:744) [na:1.7.0_45] 

what cause such behaviour?

a couple of other observations:

  • the errors not correspond peaks in load.
  • this error happens on multiple endpoints; there no definite link between these endpoints, of endpoints returning larger entities.
  • the resource method succeeding, i.e. entity fetched database along required processing , authorization.


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -