aleph

lambdam 2018-11-14T10:02:44.029700Z

@mccraigmccraig yes I think that i'm correctly shutting it down. Here is my server definition with integrant:

(defn create-aleph-server [aleph-config]
  ;; handler
  ;; middlewares...
  ;; returns aleph server
  )

(defmethod ig/init-key ::aleph [_ aleph-config]
  (create-aleph-server aleph-config))

(defmethod ig/halt-key! ::aleph [_ server]
  (.close server))

(defmethod ig/suspend-key! ::aleph [_ server]
  (.close server))

(defmethod ig/resume-key ::aleph [_key aleph-config _old-opts _old-impl]
  (create-aleph-server aleph-config))
Every time I fire cider-refresh, the server is killed and rebuilt (there is an Emacs hook with a local .dir-locals.el file):
((nil . ((cider-ns-refresh-before-fn . "integrant.repl/suspend")
         (cider-ns-refresh-after-fn  . "integrant.repl/resume"))))
Also, if I'm not mistaken, cider-refresh uses internally clojure.tools.namespace.repl/refresh. The weird thing is that on "simple" projects, this code works perfectly with aleph but with the heavier one (re-natal + web server + Datomic + integrant), aleph seems to get stuck randomly on dev with Spacemacs.

mccraigmccraig 2018-11-14T10:07:00.031100Z

i don't have any ideas @dam - your setup is quite different from mine. perhaps worth checking the socket is being released correctly when your server is .closed

lambdam 2018-11-14T10:07:51.031300Z

oh thanks

lambdam 2018-11-14T10:07:58.031500Z

I never did that

lambdam 2018-11-14T10:08:29.032Z

Do you have any piece of advice to do that on Linux. What tool?

valerauko 2018-11-14T13:59:28.032200Z

@dam it's a known bug

valerauko 2018-11-14T13:59:56.032400Z

https://github.com/ztellman/aleph/issues/365

valerauko 2018-11-14T14:00:28.033200Z

apparently it SOMETIMES breaks

valerauko 2018-11-14T14:01:49.033600Z

i ran into this issue just today while debugging something else

lambdam 2018-11-14T21:27:08.034300Z

oh thanks @vale, it seems to be exactly that