leiningen

N.B. The maintainers are on #leiningen on Libera chat IRC. Go there for direct support/bug reports.
Will 2020-05-15T21:06:35.127500Z

running

lein uberjar
as part of our Azure Dev Ops CI/CD pipeline has been taking forever. It sometimes times out after 60 mins. If it does complete it takes at least 20. I'm not really sure how to even begin to diagnose (I'm new leiningen and Java in general). Running locally works fine. I did find that adding these jvm options to the project.clj file sped things up on my laptop. But they seem to have the opposite affect on our CI/CD pipeline.
:jvm-opts ["-Xms2g" "-Xmx2g" "-XX:-UseCompressedOops"]
the rest of our uberjar options look like:
{:uberjar {:omit-source true
             :aot :all
             :uberjar-name "<my-projects-name>.jar"
             :source-paths ["env/prod/clj"]
             :resource-paths ["env/prod/resources"]
             :jvm-opts ["-Xms2g" "-Xmx2g" "-XX:-UseCompressedOops"]}
(except we don't use those jvm-opts in the CI/CD pipeline) Could :aot :all be slowing things down? Does anyone have any thoughts or suggestions for how to further investigate? Thanks!

alexmiller 2020-05-15T21:15:32.128Z

if you set env var DEBUG to anything, lein will give you more output

2020-05-15T21:16:18.129100Z

@wyeager the most common culprit of jar building taking forever is a side effect inside a def form that creates a thread or activates a resource

2020-05-15T21:16:37.129500Z

or blocks forever and never activates the resource effectively....

2020-05-15T21:17:44.130500Z

you can use a signal (also generated by Control-\ in a local terminal) to see what all your threads are trying to do, that's often enlightening in a stalled build

2020-05-15T21:18:31.131Z

$ kill -3 PID for the PID of the java process doing the uberjar

Will 2020-05-15T21:21:36.131400Z

thanks guys! I'll give your suggestions a try!