This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aleph (6)
- # beginners (6)
- # boot (94)
- # cider (34)
- # cljs-dev (36)
- # cljsrn (12)
- # clojure (124)
- # clojure-dev (41)
- # clojure-dusseldorf (6)
- # clojure-italy (3)
- # clojure-norway (1)
- # clojure-russia (161)
- # clojure-sg (7)
- # clojure-spec (71)
- # clojure-uk (95)
- # clojurescript (38)
- # core-async (16)
- # cursive (14)
- # data-science (1)
- # datascript (12)
- # datomic (15)
- # emacs (22)
- # funcool (2)
- # hoplon (15)
- # jobs-rus (2)
- # juxt (9)
- # liberator (7)
- # lumo (1)
- # off-topic (137)
- # onyx (24)
- # pedestal (39)
- # perun (2)
- # planck (20)
- # re-frame (23)
- # spacemacs (31)
- # unrepl (5)
- # untangled (1)
- # vim (1)
- # yada (29)
@ag It shouldn't require anything -- once the task exits, the server should be shut down gracefully now, freeing up the port
but how do I force “exit” the task like this:
(deftask dev "Main build task for the local development"  (comp (dev-env) (npm-install) (sassc) (watch) (serve :reload true) (notify :audible true :theme "woodblock" :visual true :title "finops-admin") (reload :on-jsload 'finops-admin.app/init) (cljs-repl) (cljs)))
it doesn’t… so if I run it in terminal, like
$> boot repl and then
(boot (dev)) - I think then it would
I'm not sure how cider is running that -- have you ever been able to stop that task?
ie, it seems like the question is more about how to stop a task autostarted by cider, rather than specific to boot-http?
if I have a non blocking task e.g.
(future (boot (dev)) then restarting it shouldn’t be a problem, no?
If I run it again, it should work, right? but
serve has to restart jetty, how do I force it?
it seems even when it’s blocking: I press
C-c - it says Stopping jetty, I would start the task again (blocking fashion
(boot (dev)) - it’s blocking because
watch is blocking. It still would complain:
Java.net.BindException: Address already in use
Yeah, I think there was a bug that was keeping Jetty from actually being stopped. Like I said, try
0.8.0 -- should be fixed.
@ag I just tried exiting with C-c C-c and I'm able to re-run the
serve task again from the REPL
I do see a
java.lang.InterruptedException thrown from Jetty though, not sure what's up with that
So it exits properly (ie, jetty exits, port is released) if I do
(boot (serve))... But if
serve is part of a pipeline, such as
(boot (comp (serve) (wait))), there is that exception and the boot process seems to go into some kind of loop, pegging multiple cores 😕
@bhagany here's a gist with the stacktrace: https://gist.github.com/pandeiro/7c81bed35fb00a7154df505c72182e0c
@pandeiro regarding the exception, it looks like jetty thinks it's in the middle of serving requests for some reason. still working on that
@bhagany maybe something wrong in my task? https://clojurians.slack.com/archives/C053K90BR/p1493078741815433
if it gets to the point of printing that output, I don't see how it wouldn't be calling the stop fn
the exception also seems to be cider-related.
boot serve wait on the command line exits cleanly when interrupted
(boot (comp (serve)(wait))) - it worked. But how do I stop it when it starts “non-blocking”, e.g.
$> boot serve wait repl?
That’s my point - that’s what I’ve been asking for quite sometime: Is it possible to somehow stop the jetty server? or expose the jetty server (so it can be explicitly stopped) that
okay, I haven't followed you until now, I thought you were restarting the whole task. I'm not sure what you want to do fits with the boot model
I don't really see how boot-http could expose the jetty server in the way that you'd need
I'm not sure I see a good way, either -- but I also don't understand why you'd want to restart Jetty -- is it just to pick up on changes?
serve task technically is the only reason right now preventing me from staying in the repl all the time - repl still needs to be restarted from time to time
If I add a dependency I have to restart my main build task:
dev, I can’t restart it because of
if it's a a clojure or clojurescript dep, you should be able to call
(merge-env! :dependencies '[[my/new-dep "0.1.0"]]) and further iterations of the task loop should see it
@bhagany it seems repl-related, but not cider-related (i was able to produce exception at a vanilla
same, I had just tried that. Still references nrepl though... I'm trying to figure out a way to start a repl without involving nrepl, if that's possible...
I think the problem is here: https://github.com/boot-clj/boot/blob/743eb0599770cc3418160841495a3aaa222567f9/boot/core/src/boot/core.clj#L1035
I would like to explore what the command line entry point is doing differently from the
boot fn, but I'm having trouble finding where that's implemented
new hypothesis: the SIGINT is killing Jetty via a path that's not the
finally clause in the
boot fn. That path is faster than
finally, and so when the
finally triggers, it finds that it can't connect to Jetty in order to stop it, and throws
the docs for
CountDownLatch.await support this hypothesis: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7u40-b43/java/util/concurrent/CountDownLatch.java#235
haven't followed the discussion, but
InterruptedException is the Java way to give a chance to a thread to stop cleanly, so it can be thrown at any point in time: a relevant blog post here: http://www.yegor256.com/2015/10/20/interrupted-exception.html
@richiardiandrea thanks for posting that. i finally understand Thread.interrupt() and InterruptedException. i feel enlightened!
Is there any way to exclude dependencies of dependencies when building an uberjar with boot?
An example I have is where a dependency of my project is basically a Java library wrapper that imports many dependencies that I’m not using, which takes unnecessary resources
is there some specific nrepl middleware (or a setting maybe) that will give me full stack traces when there’s an unhandled exception in boot repl?
(pst) after an exception happens will print the stacktrace, if that helps
I'm asking because the guys at Netlify couldn't get Boot working and it's not a priority for them.
Wondering how hard it is and whether me with no knowledge of docker could help get it added
The guys at Netlify weren't able to get it working. I might bang my head on it for a few weeks (no experience with Docker + Still new to programming) and see if I can get it working