scheduling icon indicating copy to clipboard operation
scheduling copied to clipboard

Exposing node.jar with Jetty can lead to a request timeout

Open bamedro opened this issue 8 years ago • 0 comments

If downloading the node.jar takes more than 1 minute, then Jetty raise a Timeout exception on this request. Then, it is up to the client to resume (if capable) the download.

wget handle this pretty well using the following command: wget --timestamping --tries=10 --timeout=10 --waitretry=10 http://host/rest/node.jar

However, if we don't control the client, this workaround is not always possible. For example, when using Microsoft.OSTCExtensions on Azure VMs to download and cache node.jar file for a large set of VMs in a scale set, it retries continuously without resuming. So it fails at the end. Workaround in that case is to push the node.jar file to a blob storage first.

Not sure there is a clean workaround here. To increase the timeout is certainly not an option, as letting a lot of clients downloading this node.jar file directly from the server will generate a contention point. Ease the admin to expose this node.jar file in a dedicated file storage (like a blob store, or anything else) is probably a much better approach.

Below is the raised stacktrace, for info.

[2017-10-10 12:01:28,235 536309-847 WARN o.e.j.s.HttpChannel] /rest/node.jar java.io.IOException: org.eclipse.jetty.util.SharedBlockingCallback$BlockerTimeoutException at org.eclipse.jetty.util.SharedBlockingCallback$Blocker.block(SharedBlockingCallback.java:234) at org.eclipse.jetty.server.HttpOutput.sendContent(HttpOutput.java:577) at org.eclipse.jetty.servlet.DefaultServlet.sendData(DefaultServlet.java:960) at org.eclipse.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:534) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:499) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555) at java.lang.Thread.run(Thread.java:748)

bamedro avatar Oct 10 '17 10:10 bamedro