This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-02
Channels
- # announcements (1)
- # asami (89)
- # aws (10)
- # babashka (41)
- # beginners (71)
- # calva (25)
- # cider (3)
- # clj-kondo (65)
- # cljdoc (15)
- # cljs-dev (3)
- # cljsrn (8)
- # clojure (56)
- # clojure-europe (44)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-uk (48)
- # clojured (7)
- # clojurescript (17)
- # conjure (6)
- # cursive (3)
- # datomic (9)
- # emacs (11)
- # events (3)
- # fulcro (3)
- # helix (3)
- # honeysql (7)
- # hugsql (6)
- # introduce-yourself (2)
- # jobs (2)
- # kaocha (4)
- # luminus (1)
- # nrepl (2)
- # off-topic (10)
- # pathom (7)
- # philosophy (3)
- # polylith (27)
- # reagent (18)
- # reitit (3)
- # remote-jobs (7)
- # reveal (3)
- # shadow-cljs (9)
- # slack-help (5)
- # tools-deps (9)
- # vim (48)
Hello there fellow clojurenauts! I’ve been diving into the datomic world, trying to learn the basics but one thing has been bothering me a bit. When running something like this:
(defn -main [& args]
(println "Doing stuff...")
(d/create-database client {:db-name db-name})
(d/connect client {:db-name db-name})
(println "Sutff done."))
Everything runs fine, both messages get printed pretty much as soon as the clojure runtime finishes loading, but… After that process just hangs in there for about a minute before exiting.
So far I’ve only tested it with a dev-local client. I’ve also noticed it won’t happen when running on a memory only system. So my guess would be that the JVM process is probably waiting on for some kind of timeout on a transactor thread or something like that.
So finally, my questions are: Am I on the right track here? Is there a way to signal datomic that all threads should quit immediately? Do I risk losing data if the process is killed during this timeout?A 1 minute pause is a classic sign that there a future or agent has been used, and the Clojure runtime will have a background thread that takes 1 minute to timeout before the jvm will exit
(shutdown-agents) will work to allow the jvm to exit
There is no active work here, it’d just a background cached for reuse if needed - this is not special to Datomic
Ohh, that totally makes sense! Thanks for the quick reply :)
@bardes0022 datomic on prem has a shutdown function with an optional argument to shut down the agents
Oh, even better :)
It’s been a while :)