upgrade jetty and workaround for half open connection

Upgrade jetty and set acceptor priority delta to -1
 to give priority to servicing connections already accepted rather than
opening new connections.
This commit is contained in:
nishantmonu51 2014-09-30 14:22:16 +05:30
parent 296b9236fd
commit 8cecb00aa9
2 changed files with 7 additions and 4 deletions

View File

@ -324,22 +324,22 @@
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId> <artifactId>jetty-server</artifactId>
<version>9.2.2.v20140723</version> <version>9.2.3.v20140905</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId> <artifactId>jetty-servlet</artifactId>
<version>9.2.2.v20140723</version> <version>9.2.3.v20140905</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlets</artifactId> <artifactId>jetty-servlets</artifactId>
<version>9.2.2.v20140723</version> <version>9.2.3.v20140905</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.eclipse.jetty</groupId> <groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-proxy</artifactId> <artifactId>jetty-proxy</artifactId>
<version>9.2.2.v20140723</version> <version>9.2.3.v20140905</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>joda-time</groupId> <groupId>joda-time</groupId>

View File

@ -158,6 +158,9 @@ public class JettyServerModule extends JerseyServletModule
ServerConnector connector = new ServerConnector(server); ServerConnector connector = new ServerConnector(server);
connector.setPort(node.getPort()); connector.setPort(node.getPort());
connector.setIdleTimeout(Ints.checkedCast(config.getMaxIdleTime().toStandardDuration().getMillis())); connector.setIdleTimeout(Ints.checkedCast(config.getMaxIdleTime().toStandardDuration().getMillis()));
// workaround suggested in -
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=435322#c66 for jetty half open connection issues during failovers
connector.setAcceptorPriorityDelta(-1);
server.setConnectors(new Connector[]{connector}); server.setConnectors(new Connector[]{connector});