Skip to content

Commit

Permalink
(PE-35511) Update to tk-webserver-jetty-10
Browse files Browse the repository at this point in the history
  • Loading branch information
rileynewton committed Dec 5, 2023
1 parent 40b2665 commit 939b114
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion documentation/configure.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ Sets the maximum number of threads assigned to responding to HTTP
and HTTPS requests, effectively changing how many concurrent requests
can be made at one time. Defaults to 50.

> **Note:** Due to the behaviour of our web server (Jetty 9), this setting
> **Note:** Due to the behaviour of our web server (Jetty 10), this setting
must be higher then the number of CPUs on your system or it will
stop processing any HTTP requests.

Expand Down
6 changes: 3 additions & 3 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
'[[ring/ring-mock]
[puppetlabs/trapperkeeper :classifier "test"]
[puppetlabs/kitchensink :classifier "test"]
[puppetlabs/trapperkeeper-webserver-jetty9 :classifier "test"]
[com.puppetlabs/trapperkeeper-webserver-jetty10 :classifier "test"]
[org.flatland/ordered "1.5.9"]
[org.clojure/test.check "0.9.0"]
[com.gfredericks/test.chuck "0.2.7"
Expand Down Expand Up @@ -151,8 +151,8 @@
[puppetlabs/stockpile "0.0.4"]
[puppetlabs/structured-logging]
[puppetlabs/trapperkeeper]
[puppetlabs/trapperkeeper-webserver-jetty9]
[puppetlabs/trapperkeeper-metrics]
[com.puppetlabs/trapperkeeper-webserver-jetty10]
[puppetlabs/trapperkeeper-metrics "2.0.1"]
[puppetlabs/trapperkeeper-status]
[puppetlabs/trapperkeeper-authorization]

Expand Down
2 changes: 1 addition & 1 deletion resources/puppetlabs/puppetdb/bootstrap.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# https://github.com/puppetlabs/trapperkeeper/wiki/Bootstrapping

# Web Server
puppetlabs.trapperkeeper.services.webserver.jetty9-service/jetty9-service
puppetlabs.trapperkeeper.services.webserver.jetty10-service/jetty10-service

# Webrouting
puppetlabs.trapperkeeper.services.webrouting.webrouting-service/webrouting-service
Expand Down
3 changes: 1 addition & 2 deletions src/puppetlabs/puppetdb/http/query.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
[murphy :refer [try!]]
[puppetlabs.puppetdb.query-eng :as qeng]
[puppetlabs.puppetdb.query.monitor :as qmon]
[puppetlabs.trapperkeeper.services.webserver.jetty9 :as jetty9]
[puppetlabs.i18n.core :refer [trs tru]]
[puppetlabs.kitchensink.core :as kitchensink]
[schema.core :as s]
Expand Down Expand Up @@ -429,7 +428,7 @@
;; May have no response because some tests (e.g. some
;; with-http-app based tests) don't add one right now.
monitor-id (when-let [chan (and query-monitor
(some-> (::jetty9/response req)
(some-> (:response req)
response->channel))]
(qmon/stop-query-at-deadline-or-disconnect query-monitor
query-uuid
Expand Down
3 changes: 1 addition & 2 deletions src/puppetlabs/puppetdb/pdb_routing.clj
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@
clean
delete-node))
(mid/wrap-cert-authn cert-allowlist)
mid/wrap-with-puppetdb-middleware)
{:include-response true})
mid/wrap-with-puppetdb-middleware))

(enable-maint-mode)
(pdb-status/register-pdb-status
Expand Down
2 changes: 1 addition & 1 deletion test-resources/integration-bootstrap.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
puppetlabs.trapperkeeper.services.webserver.jetty9-service/jetty9-service
puppetlabs.trapperkeeper.services.webserver.jetty10-service/jetty10-service
puppetlabs.trapperkeeper.services.webrouting.webrouting-service/webrouting-service
puppetlabs.trapperkeeper.services.metrics.metrics-service/metrics-webservice
puppetlabs.trapperkeeper.services.status.status-service/status-service
Expand Down
4 changes: 2 additions & 2 deletions test/puppetlabs/puppetdb/testutils/repl.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[puppetlabs.puppetdb.testutils :as testutils]
[me.raynes.fs :as fs]
[puppetlabs.puppetdb.cli.services :as svcs :refer [puppetdb-service]]
[puppetlabs.trapperkeeper.services.webserver.jetty9-service :refer [jetty9-service]]
[puppetlabs.trapperkeeper.services.webserver.jetty10-service :refer [jetty10-service]]
[puppetlabs.trapperkeeper.core :as tk]
[puppetlabs.trapperkeeper.app :as tka]
[clojure.tools.namespace.repl :refer (refresh)]))
Expand Down Expand Up @@ -41,7 +41,7 @@
(defn start [config-path]
(alter-var-root #'system
(fn [_] (tk/boot-services-with-cli-data
[jetty9-service puppetdb-service]
[jetty10-service puppetdb-service]
{:config config-path}))))

(defn stop []
Expand Down
11 changes: 7 additions & 4 deletions test/puppetlabs/puppetdb/testutils/services.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[clojure.walk :as walk]
[puppetlabs.trapperkeeper.app :as tk-app :refer [get-service]]
[puppetlabs.trapperkeeper.testutils.bootstrap :as tkbs]
[puppetlabs.trapperkeeper.services.webserver.jetty9-service :refer [jetty9-service]]
[puppetlabs.trapperkeeper.services.webserver.jetty10-service :refer [jetty10-service]]
[puppetlabs.trapperkeeper.services.webrouting.webrouting-service :refer [webrouting-service]]
[puppetlabs.trapperkeeper.services.status.status-service :refer [status-service]]
[puppetlabs.trapperkeeper.services.scheduler.scheduler-service :refer [scheduler-service]]
Expand Down Expand Up @@ -78,7 +78,7 @@
(def ^:dynamic *server*)

(def default-services
[#'jetty9-service
[#'jetty10-service
#'webrouting-service
#'puppetdb-service
#'command-service
Expand Down Expand Up @@ -291,8 +291,11 @@
[url-str :- String
& [opts]]
(let [resp (get-unparsed url-str opts)
ctype (rr/get-header resp "content-type")]
(if (some-> ctype json-utf8-ctype?)
ctype (rr/get-header resp "content-type")
;; See https://www.ietf.org/rfc/rfc4627.txt, UTF-8 is assumed as a default
;; encoding.
json-ctype? #(= ctype "application/json")]
(if (and ctype (or json-ctype? (json-utf8-ctype? ctype)))
(update resp :body #(json/parse-string % true))
resp)))

Expand Down

0 comments on commit 939b114

Please sign in to comment.