HBASE-18224 Upgrade Jetty

This commit is contained in:
Michael Stack 2017-08-22 13:33:08 -07:00
parent e2ce252b59
commit 8c84793d22
7 changed files with 12 additions and 11 deletions

View File

@ -1602,7 +1602,7 @@ possible configurations would overwhelm and obscure the important.
</property>
<property>
<name>hbase.http.max.threads</name>
<value>10</value>
<value>16</value>
<description>
The maximum number of threads that the HTTP Server will create in its
ThreadPool.

View File

@ -97,12 +97,12 @@ public class FavoredNodeLoadBalancer extends BaseLoadBalancer implements Favored
LOG.warn("Not running balancer since exception was thrown " + ie);
return plans;
}
Map<ServerName, ServerName> serverNameToServerNameWithoutCode = new HashMap<>();
// This is not used? Findbugs says so: Map<ServerName, ServerName> serverNameToServerNameWithoutCode = new HashMap<>();
Map<ServerName, ServerName> serverNameWithoutCodeToServerName = new HashMap<>();
ServerManager serverMgr = super.services.getServerManager();
for (ServerName sn: serverMgr.getOnlineServersList()) {
ServerName s = ServerName.valueOf(sn.getHostname(), sn.getPort(), ServerName.NON_STARTCODE);
serverNameToServerNameWithoutCode.put(sn, s);
// FindBugs complains about useless store! serverNameToServerNameWithoutCode.put(sn, s);
serverNameWithoutCodeToServerName.put(s, sn);
}
for (Map.Entry<ServerName, List<HRegionInfo>> entry : clusterState.entrySet()) {

View File

@ -74,7 +74,8 @@ public class TestHttpServer extends HttpServerFunctionalTest {
private static final Log LOG = LogFactory.getLog(TestHttpServer.class);
private static HttpServer server;
private static URL baseUrl;
private static final int MAX_THREADS = 10;
// jetty 9.4.x needs this many threads to start, even in the small.
static final int MAX_THREADS = 16;
@SuppressWarnings("serial")
public static class EchoMapServlet extends HttpServlet {
@ -150,7 +151,7 @@ public class TestHttpServer extends HttpServerFunctionalTest {
@BeforeClass public static void setup() throws Exception {
Configuration conf = new Configuration();
conf.setInt(HttpServer.HTTP_MAX_THREADS, 10);
conf.setInt(HttpServer.HTTP_MAX_THREADS, MAX_THREADS);
server = createTestServer(conf);
server.addServlet("echo", "/echo", EchoServlet.class);
server.addServlet("echomap", "/echomap", EchoMapServlet.class);

View File

@ -62,7 +62,7 @@ public class TestSSLHttpServer extends HttpServerFunctionalTest {
@BeforeClass
public static void setup() throws Exception {
conf = new Configuration();
conf.setInt(HttpServer.HTTP_MAX_THREADS, 10);
conf.setInt(HttpServer.HTTP_MAX_THREADS, TestHttpServer.MAX_THREADS);
File base = new File(BASEDIR);
FileUtil.fullyDelete(base);

View File

@ -168,7 +168,7 @@ public class TestSpnegoHttpServer extends HttpServerFunctionalTest {
Configuration conf = new Configuration();
KerberosName.setRules("DEFAULT");
conf.setInt(HttpServer.HTTP_MAX_THREADS, 10);
conf.setInt(HttpServer.HTTP_MAX_THREADS, TestHttpServer.MAX_THREADS);
// Enable Kerberos (pre-req)
conf.set("hbase.security.authentication", "kerberos");
@ -245,7 +245,7 @@ public class TestSpnegoHttpServer extends HttpServerFunctionalTest {
@Test(expected = IllegalArgumentException.class)
public void testMissingConfigurationThrowsException() throws Exception {
Configuration conf = new Configuration();
conf.setInt(HttpServer.HTTP_MAX_THREADS, 10);
conf.setInt(HttpServer.HTTP_MAX_THREADS, TestHttpServer.MAX_THREADS);
// Enable Kerberos (pre-req)
conf.set("hbase.security.authentication", "kerberos");
// Intentionally skip keytab and principal

View File

@ -112,12 +112,12 @@ public class TestThriftHttpServer {
try {
runThriftServer(1024 * 63);
} catch (TTransportException tex) {
assertFalse(tex.getMessage().equals("HTTP Response code: 413"));
assertFalse(tex.getMessage().equals("HTTP Response code: 431"));
}
// Test thrift server with HTTP header length more than 64k, expect an exception
exception.expect(TTransportException.class);
exception.expectMessage("HTTP Response code: 413");
exception.expectMessage("HTTP Response code: 431");
runThriftServer(1024 * 64);
}

View File

@ -1354,7 +1354,7 @@
<metrics-core.version>3.2.1</metrics-core.version>
<jackson.version>2.23.2</jackson.version>
<jaxb-api.version>2.2.12</jaxb-api.version>
<jetty.version>9.3.8.v20160314</jetty.version>
<jetty.version>9.4.6.v20170531</jetty.version>
<jetty-jsp.version>9.2.19.v20160908</jetty-jsp.version>
<servlet.api.version>3.1.0</servlet.api.version>
<wx.rs.api.version>2.0.1</wx.rs.api.version>