-
-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stream closed exception when multiple pod pools are initialized #270
Labels
Comments
Great report. I stripped some stuff from the (require '[boot.core :as boot]
'[boot.pod :as pod])
(defn create-pool [sym-to-require]
(println "Creating pod pool")
(pod/pod-pool (boot/get-env)
:init (fn [pod]
(println "START pool init" (pr-str pod))
(pod/require-in pod sym-to-require)
(println "END pool init" (pr-str pod)))))
(deftask pool-using-task
"Demonstrates bug that occurs when multiple pod pools are created on multiple invocations of the same task."
[o option VAL str "Some option"
s req SYM sym "symbol to require during pod init"]
(let [tmp (boot/tmp-dir!)
;; pods pool is created for each invocation of the pool-bug task
pods (create-pool req)]
(boot/with-pre-wrap fileset
(println "Get pod from pool")
(let [pod (pods :refresh)]
(pod/with-eval-in pod
(println "Eval in pod" ~(pr-str pod))))
(-> fileset (boot/add-resource tmp) boot/commit!))))
(deftask trigger-bug
[n num NUM int "number of tasks to run"
s req SYM sym "symbol to require during pod init"]
(apply comp
(for [i (range num)]
(pool-using-task :option (str i) :req req)))) To exclude the issue being related to Garden I tested with a bunch of other libs could reproduce with all of the following:
The
|
martinklepsch
pushed a commit
to martinklepsch/boot-garden
that referenced
this issue
Aug 11, 2015
make garden pod pool global to avoid StreamClosed exception: boot-clj/boot#270
@jeluard in martinklepsch/boot-garden#7 (comment)
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While working on boot-garden I noticed a
Stream closed
exception being thrown when multiple pod pools are created and initialized on multiple invocations of the same task. We've gotten around this issue in boot-garden, but the fact that the exception occurs at all suggests a potential problem with boot, so I am posting this issue to hopefully help identify a fix. The issue can be reproduced with the build.boot file below:If multiple invocations of the pool-bug task are called like so:
boot pool-bug -o 1 -- pool-bug -o 2 -- pool-bug -o 3
This can result in the following output and exception. The exception happens pretty reliably on my system, but because this seems to have something to do with the
:init
function being called concurrently, on some occasions the exception does not appear. If the exception doesn't occur for you, try rerunning the above command ~10 times, or add more invocations of thepool-bug
task.Full stacktrace
The text was updated successfully, but these errors were encountered: