[Git][java-team/trapperkeeper-webserver-jetty9-clojure][master] 6 commits: Fix compatibility with Jetty 9.4
Apollon Oikonomopoulos
gitlab at salsa.debian.org
Thu Feb 7 22:56:54 GMT 2019
Apollon Oikonomopoulos pushed to branch master at Debian Java Maintainers / trapperkeeper-webserver-jetty9-clojure
Commits:
298a5f10 by Apollon Oikonomopoulos at 2019-02-07T22:51:57Z
Fix compatibility with Jetty 9.4
Drop jetty-9.2-compat patch and cherry-pick upstream commit
3f17472c39d804dbb1ef90f264bc2dcb092bbf57 fixing compatibility with Jetty
9.4.
- - - - -
8d23c3e7 by Apollon Oikonomopoulos at 2019-02-07T22:51:57Z
d/control: switch Vcs-* to salsa
- - - - -
db764eab by Apollon Oikonomopoulos at 2019-02-07T22:51:57Z
Bump Standards-Version to 4.3.0; no changes needed
- - - - -
782202cf by Apollon Oikonomopoulos at 2019-02-07T22:51:57Z
d/copyright: bump debian/* years
- - - - -
7243b686 by Apollon Oikonomopoulos at 2019-02-07T22:51:57Z
Bump dh compat to 11; no changes needed
- - - - -
6c7a66b3 by Apollon Oikonomopoulos at 2019-02-07T22:51:57Z
Release 1.7.0-2
- - - - -
10 changed files:
- debian/changelog
- debian/compat
- debian/control
- debian/copyright
- + debian/patches/0001-SERVER-2213-Remove-call-to-MBeanContainer-resetUniqu.patch
- + debian/patches/0003-TK-369-Add-LifeCycleImplementingRequestLogImpl.patch
- + debian/patches/0004-Implement-LifeCycle-methods-missing-from-RequestLogI.patch
- − debian/patches/jetty-9.2-compat
- + debian/patches/jetty-9.4-compat
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,13 @@
+trapperkeeper-webserver-jetty9-clojure (1.7.0-2) unstable; urgency=medium
+
+ * Fix compatibility with Jetty 9.4
+ * d/control: switch Vcs-* to salsa
+ * Bump Standards-Version to 4.3.0; no changes needed
+ * d/copyright: bump debian/* years
+ * Bump dh compat to 11; no changes needed
+
+ -- Apollon Oikonomopoulos <apoikos at debian.org> Thu, 07 Feb 2019 20:23:37 +0200
+
trapperkeeper-webserver-jetty9-clojure (1.7.0-1) unstable; urgency=medium
* Initial release (Closes: #855745)
=====================================
debian/compat
=====================================
@@ -1 +1 @@
-10
+11
=====================================
debian/control
=====================================
@@ -4,7 +4,7 @@ Priority: optional
Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
Uploaders: Apollon Oikonomopoulos <apoikos at debian.org>
Build-Depends:
- debhelper (>= 10),
+ debhelper (>= 11),
javahelper (>= 0.32),
maven-repo-helper (>= 1.7),
clojure (>= 1.8),
@@ -23,9 +23,9 @@ Build-Depends:
libpuppetlabs-i18n-clojure,
libtext-markdown-perl | markdown,
default-jdk-headless
-Standards-Version: 4.0.0
-Vcs-Git: https://anonscm.debian.org/git/pkg-java/trapperkeeper-webserver-jetty9-clojure.git
-Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/trapperkeeper-webserver-jetty9-clojure.git
+Standards-Version: 4.3.0
+Vcs-Git: https://salsa.debian.org/java-team/trapperkeeper-webserver-jetty9-clojure.git
+Vcs-Browser: https://salsa.debian.org/java-team/trapperkeeper-webserver-jetty9-clojure
Homepage: https://github.com/puppetlabs/trapperkeeper-webserver-jetty9
Package: libtrapperkeeper-webserver-jetty9-clojure
=====================================
debian/copyright
=====================================
@@ -21,7 +21,7 @@ License: Apache-2.0
be found in "/usr/share/common-licenses/Apache-2.0"
Files: debian/*
-Copyright: 2017 Apollon Oikonomopoulos <apoikos at debian.org>
+Copyright: 2017-2019 Apollon Oikonomopoulos <apoikos at debian.org>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
=====================================
debian/patches/0001-SERVER-2213-Remove-call-to-MBeanContainer-resetUniqu.patch
=====================================
@@ -0,0 +1,30 @@
+From: Justin Stoller <justin.stoller at gmail.com>
+Date: Thu, 5 Jul 2018 11:15:51 -0700
+Subject: [PATCH] (SERVER-2213) Remove call to MBeanContainer/resetUnique
+
+In a0cb4247e7f99f79c67f08acd6bdae2ac5bf1f8e of Jetty the functionality
+of resetUnique was folded into the default behavior of destroy, which we
+already call in core/shutdown as part of our normal shutdown procedure.
+---
+ src/puppetlabs/trapperkeeper/services/webserver/jetty9_service.clj | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/puppetlabs/trapperkeeper/services/webserver/jetty9_service.clj b/src/puppetlabs/trapperkeeper/services/webserver/jetty9_service.clj
+index db6203b..1940d80 100644
+--- a/src/puppetlabs/trapperkeeper/services/webserver/jetty9_service.clj
++++ b/src/puppetlabs/trapperkeeper/services/webserver/jetty9_service.clj
+@@ -1,5 +1,4 @@
+ (ns puppetlabs.trapperkeeper.services.webserver.jetty9-service
+- (:import (org.eclipse.jetty.jmx MBeanContainer))
+ (:require
+ [clojure.tools.logging :as log]
+
+@@ -49,8 +48,6 @@
+ (doseq [key (keys (:jetty9-servers context))]
+ (if-let [server (key (:jetty9-servers context))]
+ (core/shutdown server)))
+- ;; this class leaks MBean names if this method is not called
+- (MBeanContainer/resetUnique)
+ context)
+
+ (add-context-handler [this base-path context-path]
=====================================
debian/patches/0003-TK-369-Add-LifeCycleImplementingRequestLogImpl.patch
=====================================
@@ -0,0 +1,85 @@
+From: Matthaus Owens <matthaus at puppet.com>
+Date: Thu, 2 Mar 2017 10:44:01 -0800
+Subject: (TK-369) Add LifeCycleImplementingRequestLogImpl
+
+As of Jetty 9.3, logback's RequestLogImpl will no longer auto-start
+because it no longer implements Jetty's LifeCycle interface (because
+Jetty refactored the RequestLog interfact to no longer extend the
+LifeCycle interface). In order for our request logger to auto-start, we
+extend logback's implementation and have it implement Jetty's LifeCycle
+interface (which it already does).
+---
+ .../utils/LifeCycleImplementingRequestLogImpl.java | 32 ++++++++++++++++++++++
+ .../services/webserver/jetty9_config.clj | 7 ++---
+ 2 files changed, 35 insertions(+), 4 deletions(-)
+ create mode 100644 java/com/puppetlabs/trapperkeeper/services/webserver/jetty9/utils/LifeCycleImplementingRequestLogImpl.java
+
+diff --git a/java/com/puppetlabs/trapperkeeper/services/webserver/jetty9/utils/LifeCycleImplementingRequestLogImpl.java b/java/com/puppetlabs/trapperkeeper/services/webserver/jetty9/utils/LifeCycleImplementingRequestLogImpl.java
+new file mode 100644
+index 0000000..c29363a
+--- /dev/null
++++ b/java/com/puppetlabs/trapperkeeper/services/webserver/jetty9/utils/LifeCycleImplementingRequestLogImpl.java
+@@ -0,0 +1,32 @@
++package com.puppetlabs.trapperkeeper.services.webserver.jetty9.utils;
++
++import ch.qos.logback.access.jetty.RequestLogImpl;
++import org.eclipse.jetty.util.component.LifeCycle;
++
++/*
++ Sit down, it's story time.
++ Once upon a time logback had a RequestLogImpl that you could just drop in
++ Jetty and use without any modifications. Developers used this and it was
++ good. Then, during Jetty 9.3 development, the RequestLog interface that
++ RequestLogImpl implemented was "refactored"[0] to no longer extend Jetty's
++ LifeCycle interface (this is distinct from Logback's LifeCycle interface,
++ so try to keep up).
++ Implementing Jetty's LifeCycle interface turns out to be important because
++ Jetty uses it to decide whether or not to automatically start a Bean[1].
++ Many people were sad about this[2] and tried to make the RequestLogImpl
++ again start automatically with Jetty[3], but their efforts have so far not
++ been merged.
++ In order for our RequestLogImpl to automatically start, we decide to extend
++ the existing built-in logback implementation and have it implement Jetty's
++ LifeCycle interface, which it already does, but doesn't declare.
++
++ [0] - https://github.com/eclipse/jetty.project/commit/e3bda4ef
++ [1] - https://github.com/eclipse/jetty.project/blob/0c8273f2ca1f9bf2064cd9c4c939d2546443f759/jetty-util/src/main/java/org/eclipse/jetty/util/component/ContainerLifeCycle.java#L98
++ [2] - https://jira.qos.ch/browse/LOGBACK-1052
++ [3] - https://github.com/qos-ch/logback/pull/269
++
++ And Jetty and Logback lived happily ever after.
++
++ */
++
++public class LifeCycleImplementingRequestLogImpl extends RequestLogImpl implements LifeCycle {}
+diff --git a/src/puppetlabs/trapperkeeper/services/webserver/jetty9_config.clj b/src/puppetlabs/trapperkeeper/services/webserver/jetty9_config.clj
+index 21a6085..7c8629f 100644
+--- a/src/puppetlabs/trapperkeeper/services/webserver/jetty9_config.clj
++++ b/src/puppetlabs/trapperkeeper/services/webserver/jetty9_config.clj
+@@ -2,11 +2,11 @@
+ (:import [java.security KeyStore]
+ (java.io FileInputStream)
+ (org.eclipse.jetty.server.handler RequestLogHandler)
+- (ch.qos.logback.access.jetty RequestLogImpl)
+ (org.eclipse.jetty.server Server)
+ (org.codehaus.janino ScriptEvaluator)
+ (org.codehaus.commons.compiler CompileException)
+- (java.lang.reflect InvocationTargetException))
++ (java.lang.reflect InvocationTargetException)
++ (com.puppetlabs.trapperkeeper.services.webserver.jetty9.utils LifeCycleImplementingRequestLogImpl))
+ (:require [clojure.tools.logging :as log]
+ [clojure.string :as str]
+ [me.raynes.fs :as fs]
+@@ -444,11 +444,10 @@
+ init-log-handler :- RequestLogHandler
+ [config :- WebserverRawConfig]
+ (let [handler (RequestLogHandler.)
+- logger (RequestLogImpl.)]
++ logger (LifeCycleImplementingRequestLogImpl.)]
+ (.setFileName logger (:access-log-config config))
+ (.setQuiet logger true)
+ (.setRequestLog handler logger)
+- (.start logger)
+ handler))
+
+ (defn maybe-init-log-handler
=====================================
debian/patches/0004-Implement-LifeCycle-methods-missing-from-RequestLogI.patch
=====================================
@@ -0,0 +1,56 @@
+From: Apollon Oikonomopoulos <apoikos at debian.org>
+Date: Fri, 8 Feb 2019 00:38:26 +0200
+Subject: Implement LifeCycle methods missing from RequestLogImpl
+
+For some reason, our version of logback-access lacks some of Jetty 9.4's
+LifeCycle methods. Implement them locally until we figure out what's
+happening with the logback package.
+---
+ .../utils/LifeCycleImplementingRequestLogImpl.java | 37 +++++++++++++++++++++-
+ 1 file changed, 36 insertions(+), 1 deletion(-)
+
+diff --git a/java/com/puppetlabs/trapperkeeper/services/webserver/jetty9/utils/LifeCycleImplementingRequestLogImpl.java b/java/com/puppetlabs/trapperkeeper/services/webserver/jetty9/utils/LifeCycleImplementingRequestLogImpl.java
+index c29363a..019cdcf 100644
+--- a/java/com/puppetlabs/trapperkeeper/services/webserver/jetty9/utils/LifeCycleImplementingRequestLogImpl.java
++++ b/java/com/puppetlabs/trapperkeeper/services/webserver/jetty9/utils/LifeCycleImplementingRequestLogImpl.java
+@@ -29,4 +29,39 @@ import org.eclipse.jetty.util.component.LifeCycle;
+
+ */
+
+-public class LifeCycleImplementingRequestLogImpl extends RequestLogImpl implements LifeCycle {}
++public class LifeCycleImplementingRequestLogImpl extends RequestLogImpl implements LifeCycle {
++ @Override
++ public boolean isRunning() {
++ return isStarted();
++ }
++
++ @Override
++ public boolean isStarting() {
++ return false;
++ }
++
++ @Override
++ public boolean isStopping() {
++ return false;
++ }
++
++ @Override
++ public boolean isStopped() {
++ return !isStarted();
++ }
++
++ @Override
++ public boolean isFailed() {
++ return false;
++ }
++
++ @Override
++ public void addLifeCycleListener(Listener listener) {
++ // we'll implement this when asked
++ }
++
++ @Override
++ public void removeLifeCycleListener(Listener listener) {
++ // we'll implement this when asked
++ }
++}
=====================================
debian/patches/jetty-9.2-compat deleted
=====================================
@@ -1,22 +0,0 @@
-From f42579905d33d06038ac9a4b60b5943d2883edce Mon Sep 17 00:00:00 2001
-From: Apollon Oikonomopoulos <apollon at skroutz.gr>
-Date: Tue, 7 Feb 2017 15:00:16 +0200
-Subject: [PATCH] PATCH: jetty 9.2 compat
-
-setMimeTypes is no longer supported
----
- puppetlabs/trapperkeeper/services/webserver/jetty9_core.clj | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
---- a/src/puppetlabs/trapperkeeper/services/webserver/jetty9_core.clj
-+++ b/src/puppetlabs/trapperkeeper/services/webserver/jetty9_core.clj
-@@ -390,8 +390,7 @@
- [handler]
- (doto (GzipHandler.)
- (.setHandler handler)
-- (.setMimeTypes (gzip-excluded-mime-types))
-- (.setExcludeMimeTypes true)))
-+ (.addExcludedMimeTypes (into-array (gzip-excluded-mime-types)))))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;; Handler Helper Functions
=====================================
debian/patches/jetty-9.4-compat
=====================================
@@ -0,0 +1,324 @@
+From: Matthaus Owens <matthaus at puppet.com>
+Date: Wed, 22 Feb 2017 10:42:28 -0800
+Subject: [PATCH] (TK-369) Update jetty dependency to 9.4.1
+
+This commit updates jetty to 9.4.1, which requires several changes to
+tests and the config and core namespaces. Here are a list of changes and
+why they were made:
+
+Code changes
+
+* Manually start the request logger when set
+ This change
+ https://github.com/eclipse/jetty.project/commit/34a8da2ba26a806413f06ab18fdfad535de45cfa
+ seems to have caused logging to no longer work without starting here.
+ Starting after the server was started did not do the right thing.
+
+* GzipHandler changes
+ GzipHandler moved into a new package, into jetty-server from
+ jetty-servlets and some of the setup methods changed, notably
+ around excluding mime types.
+
+* ProxyServlet changes
+ Several methods in the ProxyServlet and AbstractProxyServlet were
+ deprecated, so the methods being proxied also have been updated.
+
+* Enable client redirects
+ The http connection used for proxies began clearing all handlers in
+ https://github.com/eclipse/jetty.project/commit/c7cff6ec7e28f74156d8f78bada08ae5c9cabf48#diff-571b48f4ff5fbf0a57c41ad7c7ac5dedR297
+ so we must manually add the redirect handler back on to correctly
+ handle 302s
+
+* Disable symlinks
+ In https://github.com/eclipse/jetty.project/commit/d8e6331434fbb6025301f06f03230c6f6cad7676,
+ symlink aliases were allowed by default on all unix platforms, so we
+ clear aliases when follow-symlinks is false.
+
+Test changes
+
+* 431 now returned for headers that are too long instead of 413
+
+* SSLException thrown instead of ConnectException for some errors
+
+* URIUtil decodePath changes
+ decodePath was changed during a refactor. Path traversal is still
+ protected against, but the characters returned have changed, and
+ additionally semicolons no longer terminate parsing.
+---
+ CHANGELOG.md | 6 ++++
+ project.clj | 2 +-
+ .../services/webserver/jetty9_config.clj | 1 +
+ .../services/webserver/jetty9_core.clj | 35 ++++++++++++----------
+ .../webserver/jetty9_default_config_test.clj | 13 ++++----
+ .../services/webserver/jetty9_service_test.clj | 12 +++++---
+ .../webserver/normalized_uri_helpers_test.clj | 6 ++--
+ 7 files changed, 46 insertions(+), 29 deletions(-)
+
+diff --git a/CHANGELOG.md b/CHANGELOG.md
+index 63268c6..74a91fe 100644
+--- a/CHANGELOG.md
++++ b/CHANGELOG.md
+@@ -1,3 +1,9 @@
++## 2.0.0
++
++The is a major release
++
++* [TK-369](https://tickets.puppetlabs.com/browse/TK-369) Move Jetty dependency to 9.4.1
++
+ ## 1.7.0
+
+ This is a feature and bugfix release.
+diff --git a/project.clj b/project.clj
+index 3826cbd..3bf7ba0 100644
+--- a/project.clj
++++ b/project.clj
+@@ -1,4 +1,4 @@
+-(def jetty-version "9.2.10.v20150310")
++(def jetty-version "9.4.1.v20170120")
+
+ (defproject puppetlabs/trapperkeeper-webserver-jetty9 "1.7.0"
+ :description "A jetty9-based webserver implementation for use with the puppetlabs/trapperkeeper service framework."
+diff --git a/src/puppetlabs/trapperkeeper/services/webserver/jetty9_config.clj b/src/puppetlabs/trapperkeeper/services/webserver/jetty9_config.clj
+index 20e564a..21a6085 100644
+--- a/src/puppetlabs/trapperkeeper/services/webserver/jetty9_config.clj
++++ b/src/puppetlabs/trapperkeeper/services/webserver/jetty9_config.clj
+@@ -448,6 +448,7 @@
+ (.setFileName logger (:access-log-config config))
+ (.setQuiet logger true)
+ (.setRequestLog handler logger)
++ (.start logger)
+ handler))
+
+ (defn maybe-init-log-handler
+diff --git a/src/puppetlabs/trapperkeeper/services/webserver/jetty9_core.clj b/src/puppetlabs/trapperkeeper/services/webserver/jetty9_core.clj
+index 566b445..99c9885 100644
+--- a/src/puppetlabs/trapperkeeper/services/webserver/jetty9_core.clj
++++ b/src/puppetlabs/trapperkeeper/services/webserver/jetty9_core.clj
+@@ -3,22 +3,22 @@
+ HttpConfiguration HttpConnectionFactory
+ ConnectionFactory AbstractConnectionFactory)
+ (org.eclipse.jetty.server.handler AbstractHandler ContextHandler HandlerCollection
+- ContextHandlerCollection AllowSymLinkAliasChecker StatisticsHandler HandlerWrapper)
++ ContextHandlerCollection AllowSymLinkAliasChecker
++ StatisticsHandler HandlerWrapper)
++ (org.eclipse.jetty.server.handler.gzip GzipHandler)
+ (org.eclipse.jetty.util.resource Resource)
+ (org.eclipse.jetty.util.thread QueuedThreadPool)
+ (org.eclipse.jetty.util.ssl SslContextFactory)
+ (javax.servlet.http HttpServletResponse)
+ (java.util.concurrent TimeoutException)
+- (org.eclipse.jetty.servlets.gzip GzipHandler)
+ (org.eclipse.jetty.servlet ServletContextHandler ServletHolder DefaultServlet)
+ (org.eclipse.jetty.webapp WebAppContext)
+- (java.util HashSet)
+ (org.eclipse.jetty.http MimeTypes HttpHeader HttpHeaderValue)
+ (javax.servlet Servlet ServletContextListener)
+ (org.eclipse.jetty.proxy ProxyServlet)
+ (java.net URI)
+ (java.security Security)
+- (org.eclipse.jetty.client HttpClient)
++ (org.eclipse.jetty.client HttpClient RedirectProtocolHandler)
+ (clojure.lang Atom)
+ (java.lang.management ManagementFactory)
+ (org.eclipse.jetty.jmx MBeanContainer)
+@@ -382,7 +382,7 @@
+ (.startsWith % "video/"))
+ (MimeTypes/getKnownMimeTypes))
+ (conj "application/compress" "application/zip" "application/gzip" "text/event-stream")
+- (HashSet.)))
++ (into-array)))
+
+ (defn- gzip-handler
+ "Given a handler, wrap it with a GzipHandler that will compress the response
+@@ -390,8 +390,7 @@
+ [handler]
+ (doto (GzipHandler.)
+ (.setHandler handler)
+- (.setMimeTypes (gzip-excluded-mime-types))
+- (.setExcludeMimeTypes true)))
++ (.setExcludedMimeTypes (gzip-excluded-mime-types))))
+
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;; Handler Helper Functions
+@@ -437,7 +436,7 @@
+ (:ssl-config options)))
+ {:keys [request-buffer-size idle-timeout]} options]
+ (proxy [ProxyServlet] []
+- (rewriteURI [req]
++ (rewriteTarget [req]
+ (let [query (.getQueryString req)
+ scheme (let [target-scheme (:scheme options)]
+ (condp = target-scheme
+@@ -458,8 +457,8 @@
+ (codec/url-decode (str query))
+ nil)]
+ (if-let [rewrite-uri-callback-fn (:rewrite-uri-callback-fn options)]
+- (rewrite-uri-callback-fn target-uri req)
+- target-uri))))
++ (str (rewrite-uri-callback-fn target-uri req))
++ (str target-uri)))))
+
+ (newHttpClient []
+ (let [client (if custom-ssl-ctxt-factory
+@@ -477,22 +476,25 @@
+ timeout (when idle-timeout
+ (* 1000 idle-timeout))]
+ (if (:follow-redirects options)
+- (.setFollowRedirects client true)
++ (do
++ (.setFollowRedirects client true)
++ (.put (.getProtocolHandlers client) (RedirectProtocolHandler. client)))
+ (.setFollowRedirects client false))
+ (when timeout
+ (.setIdleTimeout client timeout))
+ client))
+
+- (customizeProxyRequest [proxy-req req]
++ (sendProxyRequest [req resp proxy-req]
+ (if-let [callback-fn (:callback-fn options)]
+- (callback-fn proxy-req req)))
++ (callback-fn proxy-req req))
++ (proxy-super sendProxyRequest req resp proxy-req))
+
+ ;; The implementation of onResponseFailure is duplicated heavily from:
+ ;; https://github.com/eclipse/jetty.project/blob/jetty-9.2.10.v20150310/jetty-proxy/src/main/java/org/eclipse/jetty/proxy/AbstractProxyServlet.java#L576-L607
+ ;; The only significant difference is that a 'failure-callback-fn', if
+ ;; defined in options, is invoked just prior to completing the async
+ ;; context for cases that the response was not already committed upstream.
+- (onResponseFailure [req resp proxy-resp failure]
++ (onProxyResponseFailure [req resp proxy-resp failure]
+ (do
+ (let [request-id (.getRequestId this req)
+ async-context (.getAsyncContext req)]
+@@ -702,8 +704,9 @@
+ enable-trailing-slash-redirect? (:enable-trailing-slash-redirect? options)
+ normalize-request-uri? (:normalize-request-uri? options)]
+ (.setBaseResource handler (Resource/newResource base-path))
+- (when follow-links?
+- (.addAliasCheck handler (AllowSymLinkAliasChecker.)))
++ (if follow-links?
++ (.addAliasCheck handler (AllowSymLinkAliasChecker.))
++ (.clearAliasChecks handler))
+ ;; register servlet context listeners (if any)
+ (when-not (nil? context-listeners)
+ (dorun (map #(.addEventListener handler %) context-listeners)))
+diff --git a/test/clj/puppetlabs/trapperkeeper/services/webserver/jetty9_default_config_test.clj b/test/clj/puppetlabs/trapperkeeper/services/webserver/jetty9_default_config_test.clj
+index 6cc3a25..eaf0d86 100644
+--- a/test/clj/puppetlabs/trapperkeeper/services/webserver/jetty9_default_config_test.clj
++++ b/test/clj/puppetlabs/trapperkeeper/services/webserver/jetty9_default_config_test.clj
+@@ -90,8 +90,11 @@ react accordingly."
+
+ (def selector-thread-count
+ "The number of selector threads that should be allocated per connector. See:
+- https://github.com/eclipse/jetty.project/blob/jetty-9.2.10.v20150310/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java#L229"
+- (max 1 (min 4 (int (/ (ks/num-cpus) 2)))))
++ https://github.com/eclipse/jetty.project/blob/jetty-9.4.1.v20170120/jetty-server/src/main/java/org/eclipse/jetty/server/ServerConnector.java#L223
++ and
++ https://github.com/eclipse/jetty.project/blob/jetty-9.4.1.v20170120/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java#L403-L408
++ The number of selectors is twice the number of selector threads."
++ (* 2 (max 1 (min 4 (int (/ (ks/num-cpus) 2))))))
+
+ (def acceptor-thread-count
+ "The number of acceptor threads that should be allocated per connector. See:
+@@ -109,7 +112,7 @@ react accordingly."
+ (is (= acceptor-thread-count (.getAcceptors connector))
+ "Unexpected default for 'acceptor-threads' and 'ssl-acceptor-threads'")
+ (is (= selector-thread-count
+- (.getSelectorCount (.getSelectorManager connector)))
++ (* 2 (.getSelectorCount (.getSelectorManager connector))))
+ "Unexpected default for 'selector-threads' and 'ssl-selector-threads'")))
+
+ (defn get-max-threads-for-server
+@@ -177,7 +180,7 @@ react accordingly."
+ (dotimes [x 2]
+ (let [connectors (inc x)
+ required-threads (calculate-minimum-required-threads connectors)]
+- (testing (str "server with too few threads for " x " connector(s) "
++ (testing (str "server with too few threads for " connectors " connector(s) "
+ "fail(s) to start with expected error")
+ (let [server (-> required-threads
+ dec
+@@ -186,7 +189,7 @@ react accordingly."
+ (insufficient-threads-msg server)
+ (tk-log-testutils/with-test-logging
+ (.start server))))))
+- (testing (str "server with minimum required threads for " x
++ (testing (str "server with minimum required threads for " connectors
+ "connector(s) start(s) successfully")
+ (let [server (get-server required-threads connectors)]
+ (try
+diff --git a/test/clj/puppetlabs/trapperkeeper/services/webserver/jetty9_service_test.clj b/test/clj/puppetlabs/trapperkeeper/services/webserver/jetty9_service_test.clj
+index d5994d0..de3eb67 100644
+--- a/test/clj/puppetlabs/trapperkeeper/services/webserver/jetty9_service_test.clj
++++ b/test/clj/puppetlabs/trapperkeeper/services/webserver/jetty9_service_test.clj
+@@ -5,7 +5,8 @@
+ (java.net BindException)
+ (java.nio.file Paths Files)
+ (java.nio.file.attribute FileAttribute)
+- (appender TestListAppender))
++ (appender TestListAppender)
++ (javax.net.ssl SSLException))
+ (:require [clojure.test :refer :all]
+ [puppetlabs.http.client.async :as async]
+ [puppetlabs.http.client.common :as http-client-common]
+@@ -69,6 +70,8 @@
+ (throw (IllegalStateException. "Expected SSL Exception to be thrown!"))
+ (catch ConnectionClosedException e#
+ true)
++ (catch SSLException e#
++ true)
+ (catch IOException e#
+ (if (= "Connection reset by peer" (.getMessage e#))
+ true
+@@ -529,7 +532,8 @@
+ (tk-app/stop app))))
+
+ (deftest large-request-test
+- (testing (str "request to Jetty fails with a 413 error if the request header "
++ ;; This changed from 413 to 431 in https://github.com/eclipse/jetty.project/commit/e53ea55f480a959a2f1f5e2dbdbfc689d61c94a6
++ (testing (str "request to Jetty fails with a 431 error if the request header "
+ "is too large and a larger one is not set")
+ (with-app-with-config app
+ [jetty9-service
+@@ -538,7 +542,7 @@
+ (tk-log-testutils/with-test-logging
+ (let [response (http-get "http://localhost:8080/hi_world" {:headers {"Cookie" absurdly-large-cookie}
+ :as :text})]
+- (is (= (:status response) 413))))))
++ (is (= (:status response) 431))))))
+
+ (testing (str "request to Jetty succeeds with a large cookie if the request header "
+ "size is properly set")
+@@ -804,7 +808,7 @@
+ hello-webservice]
+ jetty-ssl-pem-config
+ (is (thrown?
+- ConnectionClosedException
++ SSLException
+ (http-get "https://localhost:8081/hi_world" (merge default-options-for-https-client
+ {:ssl-protocols ["SSLv3"]}))))))
+ (testing "SSLv3 is supported when configured"
+diff --git a/test/clj/puppetlabs/trapperkeeper/services/webserver/normalized_uri_helpers_test.clj b/test/clj/puppetlabs/trapperkeeper/services/webserver/normalized_uri_helpers_test.clj
+index 59ce7fb..a81db95 100644
+--- a/test/clj/puppetlabs/trapperkeeper/services/webserver/normalized_uri_helpers_test.clj
++++ b/test/clj/puppetlabs/trapperkeeper/services/webserver/normalized_uri_helpers_test.clj
+@@ -33,7 +33,7 @@
+ (testing (str "non-percent encoded parameters in uri path segments are "
+ "chopped off after normalization")
+ (is (= "/foo" (normalize-uri-path-for-string "/foo;foo=chump")))
+- (is (= "/foo/bar" (normalize-uri-path-for-string
++ (is (= "/foo/bar/baz" (normalize-uri-path-for-string
+ "/foo/bar;bar=chocolate/baz;baz=bim"))))
+ (testing (str "percent-encoded parameters in uri path segments are properly "
+ "decoded after normalization")
+@@ -116,8 +116,8 @@
+ ;;> or the surrogate pair ED A1 8C ED BE B4 into U+233B4. Decoding
+ ;;> invalid sequences may have security consequences or cause other
+ ;;> problems.
+- (is (= "��" (normalize-uri-path-for-string "%C0%AE")))
+- (is (= "/foo/��/��" (normalize-uri-path-for-string "/foo/%C0%AE/%C0%AE")))))
++ (is (= "-64-82" (normalize-uri-path-for-string "%C0%AE")))
++ (is (= "/foo/-64-82/-64-82" (normalize-uri-path-for-string "/foo/%C0%AE/%C0%AE")))))
+
+ (deftest normalize-uris-with-redundant-slashes-tests
+ (testing "uris with redundant slashes are removed"
=====================================
debian/patches/series
=====================================
@@ -1 +1,4 @@
-jetty-9.2-compat
+jetty-9.4-compat
+0001-SERVER-2213-Remove-call-to-MBeanContainer-resetUniqu.patch
+0003-TK-369-Add-LifeCycleImplementingRequestLogImpl.patch
+0004-Implement-LifeCycle-methods-missing-from-RequestLogI.patch
View it on GitLab: https://salsa.debian.org/java-team/trapperkeeper-webserver-jetty9-clojure/compare/4d7e9cf3b6593643bee280a07116cc62b89f315d...6c7a66b3fa22fa77c5bb9fbb3738718adaa8b95d
--
View it on GitLab: https://salsa.debian.org/java-team/trapperkeeper-webserver-jetty9-clojure/compare/4d7e9cf3b6593643bee280a07116cc62b89f315d...6c7a66b3fa22fa77c5bb9fbb3738718adaa8b95d
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20190207/02af1072/attachment.html>
More information about the pkg-java-commits
mailing list