Skip to content
Browse files

fix loading race condition

namespaces like could still be loading in a thread
while another was attempting to use it
  • Loading branch information
thheller committed Sep 24, 2018
1 parent 1f44c60 commit f321b390d52b69bf89e4568cf096a8d51e04575c
Showing with 11 additions and 4 deletions.
  1. +11 −4 src/main/shadow/cljs/devtools/server.clj
@@ -8,6 +8,7 @@
[shadow.http.router :as http]
[ :as rt]
[shadow.undertow :as undertow]
[ :as sb]
[ :as build-classpath]
[shadow.cljs.model :as m]
[shadow.cljs.devtools.api :as api]
@@ -44,7 +45,13 @@
;; that take a bit of time to load but are only relevant when someone
;; actually accesses the webserver. also skips generating AOT classes
;; which we don't really want for pathom+ring stuff anyways
(def require-web-ns (delay (require 'shadow.cljs.devtools.server.web)))
(def require-web-ns
;; locking so that dynamically loading build targets can't happen while this is still loading
;; should prevent a race condition where `shadow-cljs watch browser-test-build` would try
;; to use while its still loading
(locking sb/target-require-lock
(require 'shadow.cljs.devtools.server.web))))

(defn get-ring-handler [app-ref]
(let [web-root-var
@@ -220,9 +227,9 @@

(when-let [the-ns (find-ns 'cider.nrepl)]
(= '
(-> (.getAliases the-ns)
(.get 'nrepl-server)
(-> (.getAliases the-ns)
(.get 'nrepl-server)

(if use-old-nrepl?

0 comments on commit f321b39

Please sign in to comment.
You can’t perform that action at this time.