Jetty IdleTimeout
Asked Answered
T

3

12

I am migrating from jetty7.6 to jetty-9.2. I am seeing that default value of idletimeout for jetty connections is reduced 10 times.

In jetty-7.6

<Set name="maxIdleTime">300000</Set>

In jetty-9.2:

<Set name="idleTimeout"><Property name="http.timeout" default="30000"/></Set>

Why So ?

And because of this I am continuously getting below exception :

WARN:oejs.HttpChannel:qtp607635164-14195: Commit failed
java.util.concurrent.TimeoutException: Idle timeout expired: 30000/30000 ms
at org.eclipse.jetty.io.IdleTimeout.checkIdleTimeout(IdleTimeout.java:156)
at org.eclipse.jetty.io.IdleTimeout$1.run(IdleTimeout.java:50)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)..........

Thanks, Anuj

Taurus answered 28/8, 2014 at 12:3 Comment(0)
P
9

put this in your ${jetty.base}/start.ini

jetty.http.idleTimeout=300000

that will restore your previous expectations.

It was changed from a default of 5 minutes to 30 seconds as a timeout simply because that's a better choice for the majority of websites.

Photosphere answered 29/8, 2014 at 15:53 Comment(4)
I saw in jetty-http.xml : Set name="idleTimeout"><Property name="http.timeout" default="30000"/></Set> But when i tried to set java property "http.timeout" to 300000. It still shows me the same error with "30000(old value)". Why it is not set to the new value (why can't this be changed from java property) ?Taurus
That is not a java System.setProperty, its a jetty-start / jetty-xml startup property. use start.jar --list-config capture the output, then edit your question to include this output.Photosphere
FYI, this property is now jetty.http.timeoutMacaulay
@Macaulay I believe you mean jetty.http.idleTimeout since v9.3Clercq
M
0

Using Jetty 9.4 and HTTPS, the above solution doesn't work. To fix this I found an undocumented setting that doesn't appear in the .ini files:

jetty.ssl.idleTimeout=180000

Add that to your Jetty settings. start.d/<whatever>.ini or start.ini.

Macaulay answered 2/9, 2017 at 23:28 Comment(0)
H
0

The correct setting is

## Connector idle timeout in milliseconds
# jetty.ssl.idleTimeout=30000

This can be found in ssl.mod file.

Hereof answered 19/10, 2017 at 22:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.