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
Leiningen chokes with Vaadin 14 dependencies with OutOfMemoryError exception #2763
Comments
Somehow this reminds me of #1914 ... |
Thanks @glts! Setting
Eventually it gets so large, that OutOfMemoryError is thrown. Down below is excerpt of
|
I tried trimming this down but I couldn't find a way to do it safely. In the mean time I've got it emitting a warning when it detects a pathological case so people can find a workaround more easily. |
Not sure if this is the best place to ask this, but what does "pathological" mean in this context? |
Cool! May I suggest the following: (defn- max-path-count-detected? [paths nmax]
(loop [i 0, it paths]
(if (>= i nmax)
true
(when it
(recur (inc i) (next it))))))
...
(let [potential-paths (all-paths node)]
(when (max-path-count-detected? potential-paths max-path-count)
(warn "Pathological dependency tree detected; consider setting ':pedantic? false'.")) Raw iterating is much faster here and no need to create another sequence just for the sake of counting it. Also, not once I've seen "max" number was skipped due unforeseen reasons. Warning is updated to point to actual configuration option.
@technomancy is more knowledgeable here, I'm curious as well. |
"Pathological" comes from a root word pertaining to disease, but in this case it means likely to have harmful symptoms. The idea is that if the dependency checking is likely to hang or run out of memory, the user can at least understand why and find a workaround immediately rather than having to search to find out what's really going on.
I don't understand what this means; can you elaborate? We are not creating another sequence; we are simply realizing the first N elements of an existing sequence. |
My bad; was looking thorough the code after a long day :)
I'm more curious to know why this happens in leiningen, but not in maven or tools.deps |
As far as I can tell, (I haven't looked into it in a long time) Maven isn't super concerned with ensuring that you get repeatable builds, since they introduced support for version ranges which you can pull in from dependencies without being aware of it. Leiningen is basically trying to undo the damage to repeatable builds that Maven caused by introducing version ranges; in order to do this it has to walk the whole tree of possible dependency resolutions. |
FYI, it looks like CircleCI have upgraded their version of Leiningen being installed and I'm seeing this issue now after encountering something similar here: #2769 I'm using the Docker image: circleci/clojure:openjdk-11 My CircleCI config: https://github.com/ogri-la/strongbox/blob/53ec750451958f596e874d3269cda0463fa91968/.circleci/config.yml And the change that allowed it to finally go green (thanks @sanel): ogri-la/strongbox@cae9cfe |
The recent changes to pedantic checks seem to fix this. There are still a ton of warnings, but it doesn't exhaust memory and completes relatively quickly. |
Initial debugging steps
Before creating a report, especially around exceptions being thrown when running Leiningen, please check if the error still occurs after:
lein upgrade
).~/.lein/profiles.clj
(if present) out of the way. This contains third-party dependencies and plugins that can cause problems inside Leiningen.project.clj
, especially if the problem is with a plugin not working. Old versions of plugins like nREPL and CIDER (as well as others) can cause problems with newer versions of Leiningen.Describe the bug
When I try to pull Vaadin 14 libraries, by using
[com.vaadin/vaadin "14.6.8"]
dependency, lein will choke and quit with OutOfMemoryError error.This happens with Vaadin 14. Pulling dependencies for previous versions (Vaadin 6,7,8) works without problems.
To Reproduce
lein deps
in it. It will throwOutOfMemoryError
exception, at some point.tools.deps
. It works correctly.Actual behavior
Leiningen will start downloading dependencies and, at some point, stuck with CPU to 100%. After some time it will throw this:
Expected behavior
Leiningen should pull all dependencies without problems.
Link to sample project
https://github.com/sanel/vaadin14-lein-problem
Logs
https://github.com/sanel/vaadin14-lein-problem/blob/master/error-trace.edn
Environment
The text was updated successfully, but these errors were encountered: