This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-26
Channels
- # arachne (4)
- # beginners (70)
- # bigdata (1)
- # boot (373)
- # braid-chat (3)
- # cider (4)
- # cljs-dev (10)
- # cljsjs (6)
- # cljsrn (27)
- # clojars (11)
- # clojure (114)
- # clojure-austria (1)
- # clojure-czech (2)
- # clojure-dusseldorf (2)
- # clojure-greece (7)
- # clojure-italy (2)
- # clojure-nl (6)
- # clojure-russia (15)
- # clojure-serbia (11)
- # clojure-spec (92)
- # clojure-uk (5)
- # clojurescript (183)
- # component (9)
- # cursive (28)
- # datomic (36)
- # editors (4)
- # emacs (1)
- # garden (11)
- # hoplon (155)
- # lein-figwheel (7)
- # mount (47)
- # om (97)
- # onyx (25)
- # proton (3)
- # rdf (3)
- # re-frame (80)
- # reagent (9)
- # ring-swagger (9)
- # spacemacs (1)
- # untangled (145)
- # vim (2)
Hi component friends. I just got an interesting stacktrace from a component usage to which I’m not sure the best way to respond.
In this app, I’m running a persistent system that would like to be able to shutdown cleanly when it receives a SIGTERM. The bootup is, in essence:
(defn -main
[]
(let [system (volatile! (system/create-system))
runtime (Runtime/getRuntime)
shutdown? (promise)]
(.addShutdownHook runtime
(Thread. (fn []
(component/stop-system @system)
(deliver shutdown? true))))
(vswap! system component/start-system)
@shutdown?))
It… usually works as I expect, but once I got this:
Exception in thread "Thread-1" java.lang.NoClassDefFoundError: com/stuartsierra/component$update_system_reverse$fn__1373
at com.stuartsierra.component$update_system_reverse.invokeStatic(component.cljc:143)
at com.stuartsierra.component$update_system_reverse.doInvoke(component.cljc:143)
at clojure.lang.RestFn.invoke(RestFn.java:445)
at com.stuartsierra.component$stop_system.invokeStatic(component.cljc:173)
at com.stuartsierra.component$stop_system.invoke(component.cljc:165)
at com.stuartsierra.component$stop_system.invokeStatic(component.cljc:171)
at bleach.system$stop.invokeStatic(system.clj:177)
at bleach.main$fn__6067$fn__6068.invoke(main.clj:94)
at clojure.lang.AFn.run(AFn.java:22)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.stuartsierra.component$update_system_reverse$fn__1373
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
Which I presume indicates a race between the classloader disposing things and the shutdown hook being invoked
I would appreciate any thoughts on how to work around or better implement this