This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-03
Channels
- # announcements (5)
- # babashka (7)
- # beginners (119)
- # biff (4)
- # cider (7)
- # clj-kondo (26)
- # cljfx (3)
- # cljs-dev (2)
- # clojure (28)
- # clojure-austin (18)
- # clojure-europe (9)
- # clojure-france (6)
- # clojure-norway (4)
- # clojure-uk (3)
- # clojurescript (6)
- # community-development (1)
- # core-async (4)
- # cursive (9)
- # data-science (12)
- # datomic (13)
- # duct (18)
- # emacs (15)
- # etaoin (5)
- # events (13)
- # honeysql (46)
- # hyperfiddle (9)
- # jackdaw (5)
- # jobs (13)
- # keechma (4)
- # lsp (37)
- # malli (32)
- # nbb (14)
- # off-topic (10)
- # other-languages (2)
- # polylith (4)
- # programming-beginners (3)
- # reagent (27)
- # reitit (1)
- # shadow-cljs (32)
- # sql (11)
- # tools-build (5)
- # tools-deps (3)
- # vim (14)
- # xtdb (11)
Hi all, we noticed that our application does not restart when there’s an exception in HikariCP (it cannot connect) on startup
We use startup code similar to
(defn -main [& args]
(let [keys (or (duct/parse-keys args) [:duct/daemon])
profiles [:duct.profile/prod]
config (-> (duct/resource "simple/config.edn")
(duct/read-config)
(duct/prep-config profiles))
system (ig/init config keys)]
(reset! stored-config config)
(reset! stored-system system)
(duct/await-daemons system)))
(I still work at that company ;))HikariPool-1 - Exception during pool initialization
We want to restart the application when that happens, how can that be accomplished?
If hikary throws an exception then you probably can wrap the body of -main
function in try/catch block and do a retry
thanks
do you know why the exception does not crash the application?
I see in your message HikariPool-1
it seems like exception was in thread 1. I’m not an expert but assume that hikary launching separate threads and not joining them to the main application thread. So if one thread dies others will still continue to work
so maybe an exception on a separate thread that only crashes the thread
but fact of the matter is there’s no database connection after the exception, it does not retry
but not a duct issue then, but hikari
thank you
Now it stays in a “Healthy” state after it