[Git][clojure-team/trapperkeeper-clojure][debian/main] 5 commits: New upstream version 3.1.0
Jérôme Charaoui (@lavamind)
gitlab at salsa.debian.org
Fri Oct 21 01:47:30 BST 2022
Jérôme Charaoui pushed to branch debian/main at Debian Clojure Maintainers / trapperkeeper-clojure
Commits:
8b8ffe41 by Louis-Philippe Véronneau at 2020-11-13T17:18:52-05:00
New upstream version 3.1.0
- - - - -
4cf00b79 by Jérôme Charaoui at 2022-10-20T20:15:28-04:00
New upstream version 3.2.0
- - - - -
6f656db6 by Jérôme Charaoui at 2022-10-20T20:15:30-04:00
Update upstream source from tag 'upstream/3.2.0'
Update to upstream version '3.2.0'
with Debian dir cdef19e3f0fab4fce119fa919fc8d22e37e68ec8
- - - - -
4606cfb3 by Jérôme Charaoui at 2022-10-20T20:22:41-04:00
d/patches: rebase for new upstream version
- - - - -
5c03a476 by Jérôme Charaoui at 2022-10-20T20:23:06-04:00
Update changelog for 3.2.0-1 release
- - - - -
12 changed files:
- − .gitmodules
- CHANGELOG.md
- debian/changelog
- debian/patches/0003_Fix_Testsuite_Failure.patch → debian/patches/0001_Fix_Testsuite_Failure.patch
- debian/patches/0002_Lein_Local.patch → debian/patches/0001_Lein_Local.patch
- debian/patches/series
- locales/trapperkeeper.pot
- project.clj
- src/puppetlabs/trapperkeeper/app.clj
- src/puppetlabs/trapperkeeper/internal.clj
- test/puppetlabs/trapperkeeper/shutdown_test.clj
- test/puppetlabs/trapperkeeper/testutils/bootstrap.clj
Changes:
=====================================
.gitmodules deleted
=====================================
@@ -1,3 +0,0 @@
-[submodule "ext/pl-clojure-style"]
- path = ext/pl-clojure-style
- url = git://github.com/puppetlabs/pl-clojure-style.git
=====================================
CHANGELOG.md
=====================================
@@ -1,3 +1,30 @@
+## 3.2.0
+
+This is a minor feature release
+
+* Backward compatible changes to the signature of `puppetlabs.trapperkeeper.internal/shutdown!` function. Returns collection of exceptions caught during execution of shutdown sequence instead of nil.
+* Extend `stop` method of `puppetlabs.trapperkeeper.app/TrapperkeeperApp` protocol with an argument `throw?` to handle cases where exceptions in shutdown sequence should be rethrown.
+* Change default behavior of `puppetlabs.trapperkeeper.testutils.bootstrap` helper macroses to throw exception when shutdown finished abruptly.
+
+## 3.1.1
+
+This is a maintenance release
+
+* Updates to current clj-parent
+
+## 3.1.0
+
+This is a minor feature release
+
+* [PDB-4636](https://github.com/puppetlabs/trapperkeeper/pull/287) - support custom exit status/messages
+
+## 3.0.0
+
+This is a maintenance release
+
+* Updates to current clj-parent to clean up project.clj and update dependencies
+* Tests changes for readability and compatibility with Java11
+
## 2.0.1
This is a maintenance release
=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+trapperkeeper-clojure (3.2.0-1) unstable; urgency=medium
+
+ * Team upload.
+ * New upstream version 3.2.0
+ * d/patches: rebase for new upstream version
+
+ -- Jérôme Charaoui <jerome at riseup.net> Thu, 20 Oct 2022 20:16:15 -0400
+
trapperkeeper-clojure (3.1.0-4) unstable; urgency=medium
* Team upload.
=====================================
debian/patches/0003_Fix_Testsuite_Failure.patch → debian/patches/0001_Fix_Testsuite_Failure.patch
=====================================
@@ -1,10 +1,18 @@
+From: Debian Clojure Maintainers <team+clojure at tracker.debian.org>
+Date: Thu, 20 Oct 2022 20:19:48 -0400
+Subject: Fix Testsuite Failure
+
Skip 2 tests that fail due to our version of clj-time-clojure being more recent
than what upstream uses (0.11 -- quite old)
See https://tickets.puppetlabs.com/browse/TK-493 for more details.
-Index: trapperkeeper-clojure/test/puppetlabs/trapperkeeper/plugins_test.clj
-===================================================================
---- trapperkeeper-clojure.orig/test/puppetlabs/trapperkeeper/plugins_test.clj
-+++ trapperkeeper-clojure/test/puppetlabs/trapperkeeper/plugins_test.clj
+---
+ test/puppetlabs/trapperkeeper/plugins_test.clj | 30 +++++++++++++-------------
+ 1 file changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/test/puppetlabs/trapperkeeper/plugins_test.clj b/test/puppetlabs/trapperkeeper/plugins_test.clj
+index 8a6bb21..dc25dba 100644
+--- a/test/puppetlabs/trapperkeeper/plugins_test.clj
++++ b/test/puppetlabs/trapperkeeper/plugins_test.clj
@@ -21,10 +21,10 @@
#".*directory.*does not exist.*"
(bootstrap-with-empty-config ["--plugins" "/this/does/not/exist"])))))
=====================================
debian/patches/0002_Lein_Local.patch → debian/patches/0001_Lein_Local.patch
=====================================
@@ -1,13 +1,20 @@
-Patch project.clj to build locally with lein.
-Index: trapperkeeper-clojure/project.clj
-===================================================================
---- trapperkeeper-clojure.orig/project.clj
-+++ trapperkeeper-clojure/project.clj
+From: =?utf-8?b?SsOpcsO0bWUgQ2hhcmFvdWk=?= <jerome at riseup.net>
+Date: Thu, 20 Oct 2022 20:20:26 -0400
+Subject: Patch project.clj to build locally with lein.
+
+---
+ project.clj | 55 ++++++++++++++++++++++++++++++-------------------------
+ 1 file changed, 30 insertions(+), 25 deletions(-)
+
+diff --git a/project.clj b/project.clj
+index 274756b..f565446 100644
+--- a/project.clj
++++ b/project.clj
@@ -6,42 +6,44 @@
:min-lein-version "2.9.0"
-- :parent-project {:coords [puppetlabs/clj-parent "4.0.1"]
+- :parent-project {:coords [puppetlabs/clj-parent "4.6.17"]
- :inherit [:managed-dependencies]}
-
;; Abort when version ranges or version conflicts are detected in
@@ -37,35 +44,32 @@ Index: trapperkeeper-clojure/project.clj
+ [ch.qos.logback/logback-access "debian"]
;; Janino can be used for some advanced logback configurations
- [org.codehaus.janino/janino]
--
-- [clj-time]
-- [clj-commons/fs]
-- [clj-commons/clj-yaml]
--
-- [prismatic/plumbing]
-- [prismatic/schema]
--
-- [beckon]
+ [org.codehaus.janino/janino "debian"]
-
-- [puppetlabs/typesafe-config]
-- [puppetlabs/kitchensink]
-- [puppetlabs/i18n]
-- [nrepl/nrepl]
++
+ [clj-time "debian"]
+ [clj-commons/fs "debian"]
+ [clj-commons/clj-yaml "debian"]
-+
+
+- [clj-time]
+- [clj-commons/fs]
+- [clj-commons/clj-yaml]
+ [prismatic/plumbing "debian"]
+ [prismatic/schema "debian"]
-+
+
+- [prismatic/plumbing]
+- [prismatic/schema]
+ [beckon "debian"]
-+
+
+- [beckon]
+ [puppetlabs/typesafe-config "debian"]
+ [puppetlabs/kitchensink "debian"]
+ [puppetlabs/i18n "debian"]
+ [nrepl/nrepl "debian"]
-+
+
+- [puppetlabs/typesafe-config]
+- [puppetlabs/kitchensink]
+- [puppetlabs/i18n]
+- [nrepl/nrepl]
+ [org.yaml/snakeyaml "1.x"]
+ [com.fasterxml.jackson.core/jackson-core "2.x"]
+ [com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.x"]
@@ -73,8 +77,8 @@ Index: trapperkeeper-clojure/project.clj
]
:deploy-repositories [["releases" {:url "https://clojars.org/repo"
-@@ -65,14 +67,17 @@
- :dev {:source-paths ["examples/shutdown_app/src"
+@@ -61,14 +63,17 @@
+ :profiles {:dev {:source-paths ["examples/shutdown_app/src"
"examples/java_service/src/clj"]
:java-source-paths ["examples/java_service/src/java"]
- :dependencies [[puppetlabs/kitchensink :classifier "test"]]}
=====================================
debian/patches/series
=====================================
@@ -1,2 +1,2 @@
-0002_Lein_Local.patch
-0003_Fix_Testsuite_Failure.patch
+0001_Lein_Local.patch
+0001_Fix_Testsuite_Failure.patch
=====================================
locales/trapperkeeper.pot
=====================================
@@ -7,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: puppetlabs.trapperkeeper \n"
-"X-Git-Ref: 8aa311d5dc275d5f88dde3d6c4ab53e235bf32ec\n"
+"X-Git-Ref: 87802764a33be83d8ed7d02e60ed4ff791bdfc66\n"
"Report-Msgid-Bugs-To: docs at puppet.com\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
@@ -291,6 +291,10 @@ msgstr ""
msgid "Error occurred during shutdown"
msgstr ""
+#: src/puppetlabs/trapperkeeper/internal.clj
+msgid "Error during app shutdown!"
+msgstr ""
+
#: src/puppetlabs/trapperkeeper/internal.clj
msgid "Error during app buildup!"
msgstr ""
=====================================
project.clj
=====================================
@@ -1,4 +1,4 @@
-(defproject puppetlabs/trapperkeeper "3.1.0"
+(defproject puppetlabs/trapperkeeper "3.2.0"
:description "A framework for configuring, composing, and running Clojure services."
:license {:name "Apache License, Version 2.0"
@@ -6,7 +6,7 @@
:min-lein-version "2.9.0"
- :parent-project {:coords [puppetlabs/clj-parent "4.0.1"]
+ :parent-project {:coords [puppetlabs/clj-parent "4.6.17"]
:inherit [:managed-dependencies]}
;; Abort when version ranges or version conflicts are detected in
@@ -50,8 +50,7 @@
:sign-releases false}]]
;; Convenience for manually testing application shutdown support - run `lein test-external-shutdown`
- :aliases {"cljfmt" ["with-profile" "+cljfmt" "cljfmt"]
- "test-external-shutdown" ["trampoline" "run" "-m" "examples.shutdown-app.test-external-shutdown"]}
+ :aliases {"test-external-shutdown" ["trampoline" "run" "-m" "examples.shutdown-app.test-external-shutdown"]}
;; By declaring a classifier here and a corresponding profile below we'll get an additional jar
;; during `lein jar` that has all the code in the test/ directory. Downstream projects can then
@@ -59,10 +58,7 @@
;; code that we have.
:classifiers [["test" :testutils]]
- :profiles {:cljfmt {:plugins [[lein-cljfmt "0.5.0"]]
- :parent-project {:path "ext/pl-clojure-style/project.clj"
- :inherit [:cljfmt]}}
- :dev {:source-paths ["examples/shutdown_app/src"
+ :profiles {:dev {:source-paths ["examples/shutdown_app/src"
"examples/java_service/src/clj"]
:java-source-paths ["examples/java_service/src/java"]
:dependencies [[puppetlabs/kitchensink :classifier "test"]]}
=====================================
src/puppetlabs/trapperkeeper/app.clj
=====================================
@@ -38,5 +38,5 @@
"occurred, return the input parameter."))
(init [this] "Initialize the services")
(start [this] "Start the services")
- (stop [this] "Stop the services")
- (restart [this] "Stop and restart the services"))
\ No newline at end of file
+ (stop [this] [this throw?] "Stop the services")
+ (restart [this] "Stop and restart the services"))
=====================================
src/puppetlabs/trapperkeeper/internal.clj
=====================================
@@ -448,24 +448,36 @@
(shutdown-on-error [this svc-id f] (shutdown-on-error* shutdown-reason-promise app-context svc-id f))
(shutdown-on-error [this svc-id f on-error] (shutdown-on-error* shutdown-reason-promise app-context svc-id f on-error))))
-(schema/defn ^:always-validate shutdown!
+(schema/defn ^:always-validate shutdown! :- [Throwable]
"Perform shutdown calling the `stop` lifecycle function on each service,
- in reverse order (to account for dependency relationships)."
+ in reverse order (to account for dependency relationships).
+ Returns collection of exceptions thrown during shutdown sequence execution."
[app-context :- (schema/atom a/TrapperkeeperAppContext)]
(log/info (i18n/trs "Beginning shutdown sequence"))
(let [{:keys [ordered-services shutdown-channel lifecycle-worker]} @app-context
- shutdown-fn (fn [] (doseq [[service-id s] (reverse ordered-services)]
- (try
- (run-lifecycle-fn! app-context s/stop "stop" service-id s)
- (catch Exception e
- (log/error e (i18n/trs "Encountered error during shutdown sequence"))))))]
+ errors-chan (async/promise-chan)
+ shutdown-fn (fn [] (let [results
+ (doall
+ (keep
+ (fn [[service-id s]]
+ (try
+ (run-lifecycle-fn! app-context s/stop "stop" service-id s)
+ nil
+ (catch Exception e
+ (log/error e (i18n/trs "Encountered error during shutdown sequence"))
+ e)))
+ (reverse ordered-services)))]
+ (async/put! errors-chan results)))]
(log/trace (i18n/trs "Putting shutdown message on shutdown channel."))
(async/>!! shutdown-channel {:type :shutdown
:task-function shutdown-fn})
;; wait for the channel to send us the return value so we know it's done
(log/trace (i18n/trs "Waiting for response to shutdown message from lifecycle worker."))
(if (not (nil? (async/<!! lifecycle-worker)))
- (log/info (i18n/trs "Finished shutdown sequence"))
+ (do
+ (log/info (i18n/trs "Finished shutdown sequence"))
+ ;; deliver errors from stopped services if any
+ (async/<!! errors-chan))
;; else, the read from the channel returned a nil because it was closed,
;; indicating that there was already a shutdown in progress, and thus the
;; redundant shutdown request was ignored
@@ -606,8 +618,14 @@
(inc-restart-counter! this)
this)
(a/stop [this]
- (shutdown! app-context)
- this)
+ (a/stop this false))
+ (a/stop [this throw?]
+ (let [errors (shutdown! app-context)]
+ (if (and throw? (seq errors))
+ (let [msg (i18n/trs "Error during app shutdown!")]
+ (log/error msg)
+ (throw (ex-info msg {:errors errors})))
+ this)))
(a/restart [this]
(try
(run-lifecycle-fns app-context s/stop "stop" (reverse ordered-services))
=====================================
test/puppetlabs/trapperkeeper/shutdown_test.clj
=====================================
@@ -62,7 +62,8 @@
app (bootstrap-services-with-empty-config [test-service broken-service])]
(is (false? @shutdown-called?))
(logging/with-test-logging
- (internal/shutdown! (app-context app))
+ (let [errors (internal/shutdown! (app-context app))]
+ (is (= '("dangit") (map #(.getMessage ^Throwable %) errors))))
(is (logged? #"Encountered error during shutdown sequence" :error)))
(is (true? @shutdown-called?)))))
=====================================
test/puppetlabs/trapperkeeper/testutils/bootstrap.clj
=====================================
@@ -22,7 +22,7 @@
(try
~@body
(finally
- (tk-app/stop ~app))))))
+ (tk-app/stop ~app true))))))
(defn bootstrap-services-with-cli-data
[services cli-data]
@@ -37,7 +37,7 @@
(try
~@body
(finally
- (tk-app/stop ~app))))))
+ (tk-app/stop ~app true))))))
(defn bootstrap-services-with-cli-args
[services cli-args]
@@ -51,7 +51,7 @@
(try
~@body
(finally
- (tk-app/stop ~app))))))
+ (tk-app/stop ~app true))))))
(defn bootstrap-services-with-empty-config
[services]
@@ -64,7 +64,7 @@
(try
~@body
(finally
- (tk-app/stop ~app))))))
+ (tk-app/stop ~app true))))))
(defn bootstrap-with-empty-config
([]
View it on GitLab: https://salsa.debian.org/clojure-team/trapperkeeper-clojure/-/compare/3178b6793709fad4673ebfa6961ab2639a05935d...5c03a47632fc2e9a296db8f4c58d298b986af531
--
View it on GitLab: https://salsa.debian.org/clojure-team/trapperkeeper-clojure/-/compare/3178b6793709fad4673ebfa6961ab2639a05935d...5c03a47632fc2e9a296db8f4c58d298b986af531
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/20221021/de30d7c2/attachment.htm>
More information about the pkg-java-commits
mailing list